165 lines
9.5 KiB
HTML
165 lines
9.5 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_ConvertCodePagesEx" />
|
|||
|
<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_convertcodepageex" />
|
|||
|
<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_ConvertCodePagesEx</title>
|
|||
|
</head>
|
|||
|
<body id="cwbnl_convertcodepageex"><a name="cwbnl_convertcodepageex"><!-- --></a>
|
|||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|||
|
<h1 class="topictitle1"><span class="apiname">cwbNL_ConvertCodePagesEx</span></h1>
|
|||
|
<div><div class="section"><h4 class="sectiontitle">Purpose</h4><p>Convert strings from one code page to another.
|
|||
|
This API combines the following three converter APIs for the default conversion: </p>
|
|||
|
<ul><li><span class="apiname">cwbNL_CreateConverterEx</span></li>
|
|||
|
<li><span class="apiname">cwbNL_Convert</span></li>
|
|||
|
<li><span class="apiname">cwbNL_DeleteConverter</span></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>
|
|||
|
unsigned int CWB_ENTRY cwbNL_ConvertCodePagesEx(
|
|||
|
unsigned long sourceCodePage,
|
|||
|
unsigned long targetCodePage,
|
|||
|
unsigned long sourceLength,
|
|||
|
unsigned long targetLength,
|
|||
|
char *sourceBuffer,
|
|||
|
char *targetBuffer,
|
|||
|
unsigned long *numberOfErrors,
|
|||
|
unsigned long *positionOfFirstError,
|
|||
|
unsigned long *requiredLen,
|
|||
|
cwbSV_ErrHandle errorHandle);</pre>
|
|||
|
</div>
|
|||
|
<div class="section"><h4 class="sectiontitle">Parameters</h4><dl><dt class="dlterm">unsigned long sourceCodePage - input</dt>
|
|||
|
<dd>Code page of the data in the source buffer.</dd>
|
|||
|
<dt class="dlterm">unsigned long targetCodePage - input</dt>
|
|||
|
<dd>Code page to which the data should be converted.</dd>
|
|||
|
<dt class="dlterm">unsigned long sourceLength - input.</dt>
|
|||
|
<dd>Length of the source buffer</dd>
|
|||
|
<dt class="dlterm">unsigned long targetLength - input.</dt>
|
|||
|
<dd>Length of the target buffer</dd>
|
|||
|
<dt class="dlterm">char *sourceBuffer - input</dt>
|
|||
|
<dd>Buffer containing the data to convert.</dd>
|
|||
|
<dt class="dlterm">char *targetBuffer - output</dt>
|
|||
|
<dd>Buffer to contain the converted data.</dd>
|
|||
|
<dt class="dlterm">unsigned long *numberOfErrors - output</dt>
|
|||
|
<dd>Contains the number of characters that could not be converted properly.</dd>
|
|||
|
<dt class="dlterm">unsigned long *positionOfFirstError - output</dt>
|
|||
|
<dd>Contains the offset of the first character in the source buffer that could
|
|||
|
not be converted properly.</dd>
|
|||
|
<dt class="dlterm">unsigned long *requiredLen - output</dt>
|
|||
|
<dd>Actual length of the result. If requiredLen > resultLen, the return
|
|||
|
value will be CWB_BUFFER_OVERFLOW.</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>
|
|||
|
</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">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="48.51301115241636%" id="d0e155">Value</th>
|
|||
|
<th align="left" valign="top" width="51.486988847583646%" id="d0e157">Meaning</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UNICODE_F200</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">UCS2 Version 1.1 UNICODE</td>
|
|||
|
</tr>
|
|||
|
<tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UNICODE</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">UCS2 Current<sup>®</sup> Version UNICODE</td>
|
|||
|
</tr>
|
|||
|
<tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_AS400</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">iSeries server host code page</td>
|
|||
|
</tr>
|
|||
|
<tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_CLIENT_OEM</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">OEM client code page</td>
|
|||
|
</tr>
|
|||
|
<tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_CLIENT_ANSI</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">ANSI client code page</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_CLIENT_UNICODE</td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">UNICODE client code page</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF8</td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">UCS transformation form, 8–bit format</td>
|
|||
|
</tr>
|
|||
|
<tr><td align="left" valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_CLIENT</td>
|
|||
|
<td align="left" valign="top" width="51.486988847583646%" headers="d0e157 ">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="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF16BE</td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 "> UTF-16 (Big-Endian)</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF16LE</td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">UTF-16 (Little-Endian) </td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF16 </td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">CWBNL_CP_UTF16BE or CWBNL_CP_UTF16LE, depending
|
|||
|
on the platform</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF32BE </td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">UTF-32 (Big-Endian)</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF32LE </td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">UTF-34 (Little-Endian)</td>
|
|||
|
</tr>
|
|||
|
<tr><td valign="top" width="48.51301115241636%" headers="d0e155 ">CWBNL_CP_UTF32 </td>
|
|||
|
<td valign="top" width="51.486988847583646%" headers="d0e157 ">CWBNL_CP_UTF32BE or CWBNL_CP_UTF32LE, depending
|
|||
|
on the platform</td>
|
|||
|
</tr>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</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>
|