<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="Generator" content="Zarafa WebAccess v6.20.4-14107">
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<title>hu.dwim.rdbms.oracle-utf-problems-6 - trailing zero byte problem for ascii characters using utf-8?</title>
<style type="text/css">
body
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 12px;
padding: 5px 5px 5px 5px;
margin: 0px;
border-style: none;
background-color: #ffffff;
}
p, ul, li
{
margin-top: 0px;
margin-bottom: 0px;
}
</style>
</head>
<body>
<p>The converter doesn't seem to remove the second byte which is zero. ( 66 00 6F 00 6F 00 equals "foo" )<br />As far as I know UTF-8 uses only one byte per ascii character. How do I get this thing to remove the zero byte?<br /><br /><br /><br />12:20 0 RDBMS DRIBBLE Convert from 5, size is 90, content:<br />66 00 6F 00 6F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br /><br /><br />hex binary dec<br />0 0000 0<br />1 0001 1<br />2 0010 2<br />3 0011 3<br />4 0100 4<br />5 0101 5<br />6 0110 6<br />7 0111 7<br />8 1000 8<br /><br />9 1001 9<br />A 1010 10<br />B 1011 11<br />C 1100 12<br />D 1101 13<br />E 1110 14<br />F 1111 15<br /><br /><br /><br />*** How it should be:<br /><br />ORACLE> #B01100110 ; HEX: 66<br />102<br />ORACLE> (char-code #\f)<br /> <br />102<br /><br /><br /><br />*** How it is<br /><br />* (select-symtag2)<br />13:34 0 RDBMS DEBUG About to BEGIN transaction in database #<ORACLE {1002AB8041}><br />13:34 0 SQL DRIBBLE SELECT SYMTAG_KEY FROM symtag<br />13:34 0 RDBMS DEBUG Executing "SELECT SYMTAG_KEY FROM symtag"<br />STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"<br />STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"<br />13:34 0 RDBMS DEBUG Connecting in transaction #<#<STANDARD-CLASS NIL {10030AFD91}> :begin-executed-p #t {1003E4FDA1}><br />13:34 0 RDBMS DEBUG Logging on in transaction #<#<STANDARD-CLASS NIL {10030AFD91}> :begin-executed-p #t {1003E4FDA1}><br />13:34 0 RDBMS DEBUG Preparing command: "SELECT SYMTAG_KEY FROM symtag"<br />13:34 0 RDBMS DRIBBLE Statement is allocated<br />13:34 0 RDBMS DRIBBLE Retrieving column: name="??????????", type=1, size=44<br />13:34 0 RDBMS DEBUG Fetching "??????????" from buffer at index 0<br />13:34 0 RDBMS DRIBBLE Convert from 5, size is 90, content:<br />66 00 6F 00 6F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br />...<br /><br />#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {1003F01CBF}><br />* (setq x *)<br /><br />#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {1003F01CBF}><br />* (elt (elt x 0) 0)<br /><br />"???"<br />* (elt * 0)<br /><br />#\U6600 ; this should be the character #\f<br />* (setq y *)<br /><br />#\U6600<br />* (char-code y)<br /><br />26112 ; this should be the char-code 102<br />* </p>
!DSPAM:4cd1607e48581541520698!
</body>
</html>