ibm-information-center/dist/eclipse/plugins/i5OS.ic.nls_5.4.0.1/rbagswithucs2.htm

77 lines
6.3 KiB
HTML
Raw Permalink 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="concept" />
<meta name="DC.Title" content="Example: Display data with Unicode" />
<meta name="abstract" content="This example, using UCS-2 as the CCSID of DATABASE1, shows how data integrity is maintained both in storing and retrieving data." />
<meta name="description" content="This example, using UCS-2 as the CCSID of DATABASE1, shows how data integrity is maintained both in storing and retrieving data." />
<meta name="DC.Relation" scheme="URI" content="rbagswhyuseucs2.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagswithoutucs2.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbagswithucs2" />
<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>Example: Display data with Unicode</title>
</head>
<body id="rbagswithucs2"><a name="rbagswithucs2"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Display data with Unicode</h1>
<div><p>This example, using UCS-2 as the CCSID of DATABASE1, shows how
data integrity is maintained both in storing and retrieving data.</p>
<p>As in the example of Display data without Unicode information, one user
is English using CCSID 37 and the other user is Greek using CCSID 875.</p>
<p>DATABASE1 is used as in the previous example. However DATABASE1 is now
defined with CCSID 13488. (13488 is a UCS-2 CCSID.)</p>
<ul><li><img src="la280000.gif" alt="A graphical character" />alson</li>
<li>Gifford</li>
<li><img src="gm020000.gif" alt="A graphical character" /> <img src="gp010000.gif" alt="A graphical character" /> <img src="ge110000.gif" alt="A graphical character" /> <img src="gn010000.gif" alt="A graphical character" /></li>
<li><img src="go320000.gif" alt="A graphical character" /> <img src="gr010000.gif" alt="A graphical character" /> <img src="gi010000.gif" alt="A graphical character" /> <img src="gi010000.gif" alt="A graphical character" /> <img src="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" /></li>
</ul>
<p>The key difference in using UCS-2 as the CCSID of DATABASE1 is that data
integrity is maintained for each user who inputs data to the database. That
is each character, regardless of the CCSID of the inputting device, is stored
with a unique code point. (Remember that in this example the CCSID of DATABASE1
is 13488.)</p>
<dl><dt class="dlterm">Name</dt>
<dd>CCSID 13488 Stored Code Point (Hexadecimal)</dd>
<dt class="dlterm"><img src="la280000.gif" alt="A graphical character" />alson</dt>
<dd>00C5 . . .</dd>
<dt class="dlterm">Gifford</dt>
<dd>0047 . . .</dd>
<dt class="dlterm"><img src="gm020000.gif" alt="A graphical character" /> <img src="gp010000.gif" alt="A graphical character" /> <img src="ge110000.gif" alt="A graphical character" /></dt>
<dd>03A9 . . .</dd>
<dt class="dlterm"><img src="go320000.gif" alt="A graphical character" /> <img src="gr010000.gif" alt="A graphical character" /> <img src="gi010000.gif" alt="A graphical character" /> <img src="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" /></dt>
<dd>039C . . .</dd>
</dl>
<p>Assume that the Greek user wants to find all names beginning with <img src="go320000.gif" alt="A graphical character" />. The following SQL
statement can provide one name, <img src="go320000.gif" alt="A graphical character" /> <img src="go320000.gif" alt="A graphical character" /> <img src="gr010000.gif" alt="A graphical character" /> <img src="gi010000.gif" alt="A graphical character" /> <img src="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" />,
as compared to two in the previous example:</p>
<p><samp class="codeph">Select from DATABASE1 where Substr(name,1,1) = '</samp> <img src="go320000.gif" alt="A graphical character" /> <samp class="codeph">'</samp> </p>
<p>The reason for this is that each character stored in a UCS-2 tagged database
has a unique code point. This contrasts to the example of Display data without
Unicode information that had the first character in <img src="la280000.gif" alt="A graphical character" />alson stored with the same code point as the first
character in <img src="go320000.gif" alt="A graphical character" /> <img src="gr010000.gif" alt="A graphical character" /> <img src="gi010000.gif" alt="A graphical character" /> <img src="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" /></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbagswhyuseucs2.htm" title="i5/OS uses the EBCDIC encoding scheme. However, not all clients attached to it use an EBCDIC encoding scheme to store, retrieve, and process data. Therefore, some clients use Unicode as an exchange mechanism that is safe across all platforms.">Mapping of data</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbagswithoutucs2.htm" title="Problems with data integrity develop because users are operating with CCSIDs that have varied character support. That is, not all characters in CCSID 37 are available in CCSID 875 and vice versa.">Example: Display data without Unicode</a></div>
</div>
</div>
</body>
</html>