ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaik_5.4.0.1/cwbnl_createconverterex.htm

173 lines
9.8 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="cwbNL_CreateConverterEx" />
<meta name="DC.Relation" scheme="URI" content="rzaikconvnlsapis.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="cwbnl_createconverterex" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>cwbNL_CreateConverterEx</title>
</head>
<body id="cwbnl_createconverterex"><a name="cwbnl_createconverterex"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1"><span class="apiname">cwbNL_CreateConverterEx</span></h1>
<div><div class="section"><h4 class="sectiontitle">Purpose</h4><p>Create a <span class="apiname">cwbNL_Converter</span> to
be used on subsequent calls to <span class="apiname">cwbNL_Convert()</span>.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>
unsigned int CWB_ENTRY cwbNL_CreateConverterEx(
unsigned long sourceCodePage,
unsigned long targetCodePage,
cwbNL_Converter *theConverter,
cwbSV_ErrHandle errorHandle,
unsigned long shiftInShiftOutStatus,
unsigned long padLength,
char *pad);</pre>
</div>
<div class="section"><h4 class="sectiontitle">Parameters</h4><dl><dt class="dlterm">unsigned long sourceCodePage - input</dt>
<dd>Code page of the source data.</dd>
<dt class="dlterm">unsigned long targetCodePage - input</dt>
<dd>Code page to which the data should be converted.</dd>
<dt class="dlterm">cwbNL_Converter * theConverter - output</dt>
<dd>The newly created converter.</dd>
<dt class="dlterm">cwbSV_ErrHandle errorHandle - output</dt>
<dd>Handle to an error object. Any returned messages will be written to this
object. It is created with the <span class="apiname">cwbSV_CreateErrHandle</span> API.
The messages may be retrieved with the <span class="apiname">cwbSV_GetErrText</span> API.
If the parameter is set to zero, no messages will be retrievable.</dd>
<dt class="dlterm">unsigned long shiftInShiftOutStatus - input</dt>
<dd>Indicates whether the shift-in and shift-out bytes are part of the input
or output data. 0 - False, no shift-in and shift-out bytes are part of the
data string. 1 - True, shift-in and shift-out characters are part of the
data string.</dd>
<dt class="dlterm">unsigned long padLength - input</dt>
<dd>Length of pad characters. 0 - No pad characters for this conversion request
1 - 1 byte of pad character. This is valid only if the target code page is
either SBCS or DBCS code page 2 - 2 bytes of pad characters. This is valid
only if the code page is not a single-byte code page.
</dd>
<dt class="dlterm">char * pad - input</dt>
<dd>The character or characters for padding.</dd>
</dl>
</div>
<div class="section"><h4 class="sectiontitle">Return Codes</h4><p>The following list shows common return
values.</p>
<dl><dt class="dlterm">CWB_OK</dt>
<dd>Successful completion.</dd>
<dt class="dlterm">CWB_INVALID_HANDLE</dt>
<dd>Invalid handle.</dd>
<dt class="dlterm">CWB_INVALID_POINTER</dt>
<dd>NULL passed on output parameter.</dd>
<dt class="dlterm">CWBNL_ERR_CNV_UNSUPPORTED</dt>
<dd>An error occurred while attempting to convert the characters. No conversion
was done. The most common reason is that a conversion table is missing. Conversion
tables are either installed with @@xe1s@@, or retrieved from the default iSeries™ system
when needed. There may have been some problem communicating with the default iSeries system.</dd>
<dt class="dlterm">CWBNL_ERR_CNV_ERR_STATUS</dt>
<dd>This return code is used to indicate that while the requested conversion
is supported, and the conversion completed, there were some characters that
did not convert properly. Either the source buffer contained null characters,
or the characters do not exist in the target code page. Applications can choose
to ignore this return code or treat it as a warning.</dd>
<dt class="dlterm">CWBNL_ERR_CNV_INVALID_SISO_STATUS</dt>
<dd>Invalid SISO parameter.</dd>
<dt class="dlterm">CWBNL_ERR_CNV_INVALID_PAD_LENGTH</dt>
<dd>Invalid Pad Length parameter.</dd>
<dt class="dlterm">CWB_NOT_ENOUGH_MEMORY</dt>
<dd>Insufficient memory.</dd>
</dl>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p>The following values may be specified on the
sourceCodePage and the targetCodePage parameters: </p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="void" border="0" rules="none"><thead align="left"><tr><th align="left" valign="top" width="45.16728624535316%" id="d0e139">Value</th>
<th align="left" valign="top" width="54.832713754646846%" id="d0e141">Meaning</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UNICODE_F200</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">UCS2 Version 1.1 UNICODE</td>
</tr>
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UNICODE</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">UCS2 Current<sup>®</sup> Version UNICODE</td>
</tr>
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_AS400</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">AS/400<sup>®</sup> host code page</td>
</tr>
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_CLIENT_OEM</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">OEM client code page</td>
</tr>
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_CLIENT_ANSI</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">ANSI client code page</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_CLIENT_UNICODE</td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">UNICODE client code page</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF8</td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">UCS transformation form, 8bit format</td>
</tr>
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_CLIENT</td>
<td align="left" valign="top" width="54.832713754646846%" headers="d0e141 ">Generic client code page. Default is CWBNL_CP_CLIENT_OEM.
CWBNL_CP_CLIENT is set to CWBNL_CP_CLIENT_ANSI when CWB_ANSI is defined, to
CWBNL_CP_CLIENT_UNICODE when CWB_UNICODE is defined and to CWBNL_CP_CLIENT_OEM
when CWB_OEM is defined.</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF16BE</td>
<td valign="top" width="54.832713754646846%" headers="d0e141 "> UTF-16 (Big-Endian)</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF16LE</td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">UTF-16 (Little-Endian) </td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF16 </td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">CWBNL_CP_UTF16BE or CWBNL_CP_UTF16LE, depending
on the platform</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF32BE </td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">UTF-32 (Big-Endian)</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF32LE </td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">UTF-34 (Little-Endian)</td>
</tr>
<tr><td valign="top" width="45.16728624535316%" headers="d0e139 ">CWBNL_CP_UTF32 </td>
<td valign="top" width="54.832713754646846%" headers="d0e141 ">CWBNL_CP_UTF32BE or CWBNL_CP_UTF32LE, depending
on the platform</td>
</tr>
</tbody>
</table>
</div>
<p>Instead of calling <span class="apiname">cwbNL_ConvertCodePagesEx</span> multiple
times with the same code pages: </p>
<ul><li>cwbNL_ConvertCodePagesEx(850, 500, ...);</li>
<li>cwbNL_ConvertCodePagesEx(850, 500, ...);</li>
<li>cwbNL_ConvertCodePagesEx(850, 500, ...);</li>
</ul>
<p>It is more efficient to create a converter and use it multiple times: </p>
<ul><li>cwbNL_CreateConverterEx(850, 500, &amp;conv, ...);</li>
<li>cwbNL_Convert(conv, ...);</li>
<li>cwbNL_Convert(conv, ...);</li>
<li>cwbNL_Convert(conv, ...);</li>
<li>cwbNL_DeleteConverter(conv, ...);</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaikconvnlsapis.htm" title="This topic describes the iSeries Access for Windows conversion NLS APIs.">iSeries Access for Windows conversion NLS APIs list</a></div>
</div>
</div>
</body>
</html>