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

92 lines
7.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="concept" />
<meta name="DC.Title" content="Example: Display data without Unicode" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.Relation" scheme="URI" content="rbagswhyuseucs2.htm" />
<meta name="DC.Relation" scheme="URI" content="rbagswithucs2.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="rbagswithoutucs2" />
<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 without Unicode</title>
</head>
<body id="rbagswithoutucs2"><a name="rbagswithoutucs2"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Display data without Unicode</h1>
<div><p>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.</p>
<p>Assume that the following names are to be entered by the English-speaking
user (display device supports a CCSID of 37):</p>
<ul><li><img src="la280000.gif" alt="A graphical character" />alson</li>
<li>Gifford</li>
</ul>
<p>When these entries are stored, the data integrity remains intact. That
is, an <img src="la280000.gif" alt="A graphical character" /> is
stored as an <img src="la280000.gif" alt="A graphical character" />.
This is because the display device CCSID and the database CCSID are both 37.</p>
<p>Assume the following names are also input into DATABASE1 by the Greek-speaking
user (display device CCSID of 875):</p>
<ul><li><img src="la280000.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="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" /></li>
</ul>
<p>DATABASE1 now consists of the following logical entries:</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="gm010000.gif" alt="A graphical character" /> <img src="ga010000.gif" alt="A graphical character" /></li>
</ul>
<p>The Greek characters that make up the name are stored as those characters
only if the same character exists within CCSID 37. If the character does not
exist, the server converts the characters using a predetermined algorithm
to a code point from code page 37. The algorithm converts <img src="go320000.gif" alt="A graphical character" /> to <img src="la280000.gif" alt="A graphical character" />.</p>
<p>The following list shows the code point used to store the first character
of each name in DATABASE1. (Using only the first character makes the example
easier by eliminating long strings of code points which are shown if the code
point is presented for each character in the name.)</p>
<dl><dt class="dlterm">Name</dt>
<dd>CCSID 37 Stored Code Point (Hexadecimal)</dd>
<dt class="dlterm"><img src="la280000.gif" alt="A graphical character" />alson</dt>
<dd>67 . . .</dd>
<dt class="dlterm">Gifford</dt>
<dd>C7 . . .</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" /> <img src="gn010000.gif" alt="A graphical character" /></dt>
<dd>53 . . .</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>67 . . .</dd>
</dl>
<p>The next step in this example is to show how data can be incorrectly selected
due to the character conversion when it was stored in the database.</p>
<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 two names: <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" /> and <img src="la280000.gif" alt="A graphical character" /> alson</p>
<p><samp class="codeph">Select from DATABASE1 where name LIKE '</samp> <img src="go320000.gif" alt="A graphical character" /> <samp class="codeph">%'</samp> </p>
<p>The search yielded an unexpected name (<img src="la280000.gif" alt="A graphical character" /> alson). This is because the first character in <img src="la280000.gif" alt="A graphical character" /> alson is 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="rbagswithucs2.htm" title="This example, using UCS-2 as the CCSID of DATABASE1, shows how data integrity is maintained both in storing and retrieving data.">Example: Display data with Unicode</a></div>
</div>
</div>
</body>
</html>