176 lines
10 KiB
HTML
176 lines
10 KiB
HTML
<?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_CreateConverter" />
|
||
<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_createconverter" />
|
||
<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_CreateConverter</title>
|
||
</head>
|
||
<body id="cwbnl_createconverter"><a name="cwbnl_createconverter"><!-- --></a>
|
||
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
<h1 class="topictitle1"><span class="apiname">cwbNL_CreateConverter</span></h1>
|
||
<div><div class="section"><h4 class="sectiontitle">Comments</h4><p><span class="apiname">cwbNL_CreateConverter</span> is
|
||
no longer supported. See <a href="cwbnl_createconverterex.htm#cwbnl_createconverterex"><span class="apiname">cwbNL_CreateConverterEx</span></a>.</p>
|
||
</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_CreateConverter(
|
||
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 <span class="keyword">iSeries™ Access for Windows<sup>®</sup></span>,
|
||
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="d0e158">Value</th>
|
||
<th align="left" valign="top" width="54.832713754646846%" id="d0e160">Meaning</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UNICODE_F200</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">UCS2 Version 1.1 UNICODE</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UNICODE</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">UCS2 Current<sup>®</sup> Version UNICODE</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_AS400</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">AS/400<sup>®</sup> host code page</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_CLIENT_OEM</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">OEM client code page</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_CLIENT_ANSI</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">ANSI client code page</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_CLIENT_UNICODE</td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">UNICODE client code page</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF8</td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">UCS transformation form, 8–bit format</td>
|
||
</tr>
|
||
<tr><td align="left" valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_CLIENT</td>
|
||
<td align="left" valign="top" width="54.832713754646846%" headers="d0e160 ">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="d0e158 ">CWBNL_CP_UTF16BE</td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 "> UTF-16 (Big-Endian)</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF16LE</td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">UTF-16 (Little-Endian) </td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF16 </td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">CWBNL_CP_UTF16BE or CWBNL_CP_UTF16LE, depending
|
||
on the platform</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF32BE </td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">UTF-32 (Big-Endian)</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF32LE </td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">UTF-34 (Little-Endian)</td>
|
||
</tr>
|
||
<tr><td valign="top" width="45.16728624535316%" headers="d0e158 ">CWBNL_CP_UTF32 </td>
|
||
<td valign="top" width="54.832713754646846%" headers="d0e160 ">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_CreateConverter(850, 500, &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> |