ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/dynamic.htm

61 lines
4.2 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="task" />
<meta name="DC.Title" content="Convert dynamic strings to and from EBCDIC, Unicode, and UTF-8" />
<meta name="abstract" content="To manipulate string variables that are computed at run time, it may be necessary to convert strings to and from extended binary-coded decimal interchange (EBCDIC), Unicode, and UTF-8." />
<meta name="description" content="To manipulate string variables that are computed at run time, it may be necessary to convert strings to and from extended binary-coded decimal interchange (EBCDIC), Unicode, and UTF-8." />
<meta name="DC.Relation" scheme="URI" content="strings.htm" />
<meta name="DC.Relation" scheme="URI" content="literal.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="dynamic" />
<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>Convert dynamic strings to and from EBCDIC, Unicode, and UTF-8</title>
</head>
<body id="dynamic"><a name="dynamic"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Convert dynamic strings to and from EBCDIC, Unicode, and UTF-8</h1>
<div><p>To manipulate string variables that are computed at run time, it
may be necessary to convert strings to and from extended binary-coded decimal
interchange (EBCDIC), Unicode, and UTF-8.</p>
<div class="section"><p>The system API that provides for code page conversion function
is iconv(). To use iconv(), follow these steps:</p>
</div>
<ol><li><span>Create a conversion descriptor with <samp class="codeph">QtqIconvOpen()</samp>.</span></li>
<li><span>Call <samp class="codeph">iconv()</samp> to use the descriptor to convert
to a string.</span></li>
<li><span>Close the descriptor by using <samp class="codeph">iconv_close</samp>.</span></li>
</ol>
<div class="section"><p>In <a href="jniex.htm">Example 3 of the using the Java™ Native
Interface for native methods examples</a>, the routine creates, uses, and
then destroys the iconv conversion descriptor within the routine. This scheme
avoids the problems with multithreaded use of an iconv_t descriptor, but for
performance sensitive code it is better to create a conversion descriptor
in static storage, and moderate multiple access to it using a mutual exclusion
(mutex) or other synchronization facility.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="strings.htm" title="Many Java Native Interface (JNI) functions accept C language-style strings as parameters. For example, the FindClass() JNI function accepts a string parameter that specifies the fully-qualified name of a classfile. If the classfile is found, it is loaded by FindClass, and a reference to it is returned to the caller of FindClass.">Strings in native methods</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="literal.htm" title="It is easier to encode literal strings in UTF-8 if the string is composed of characters with a 7-bit American Standard Code for Information Interchange (ASCII) representation.">Literal strings in native methods</a></div>
</div>
</div>
</body>
</html>