Edit C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\7.0.1\help\reference\unicode.06.5.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 xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <!-- MOTW-DISABLED saved from url=(0014)about:internet --> <title>Driver Manager and Unicode Encoding on UNIX/Linux</title> <link rel="StyleSheet" href="css/unicode.css" type="text/css" media="all" /> <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" /> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/context.js"></script> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/towwhdir.js"></script> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common/wwhpagef.js"></script> <script type="text/javascript" language="JavaScript1.2"> <!-- var WebWorksRootPath = ""; // --> </script> <script type="text/javascript" language="JavaScript1.2"> <!-- // Set reference to top level help frame // var WWHFrame = WWHGetWWHFrame("", true); // --> </script> <script type="text/javascript" language="JavaScript1.2" src="scripts/expand.js"></script> </head> <body class="" style="background-color: #FFFFEE;" onload="WWHUpdate();" onunload="WWHUnload();" onkeydown="WWHHandleKeyDown((document.all||document.getElementById||document.layers)?event:null);" onkeypress="WWHHandleKeyPress((document.all||document.getElementById||document.layers)?event:null);" onkeyup="WWHHandleKeyUp((document.all||document.getElementById||document.layers)?event:null);"> <br /> <div class="WebWorks_Breadcrumbs" style="text-align: left;"> <a class="WebWorks_Breadcrumb_Link" href="unicode.06.1.html#106446">4 Internationalization, Localization, and Unicode</a> : Driver Manager and Unicode Encoding on UNIX/Linux</div> <hr align="left" /> <blockquote> <div class="head_1"><a name="106446">Driver Manager and Unicode Encoding on UNIX/Linux</a></div> <div class="Body"><a name="106450">Unicode ODBC drivers on UNIX and Linux can use UTF-8 or UTF-16 encoding. This would </a>normally mean that a UTF-8 application could not work with a UTF-16 driver, and, conversely, that a UTF-16 application could not work with a UTF-8 driver. To accomplish the goal of being able to use a single UTF-8 or UTF-16 application with either a UTF-8 or UTF-16 driver, the Driver Manager must be able to determine with which type of encoding the application and driver use and, if necessary, convert them accordingly.</div> <div class="Body"><a name="106451">To make this determination, the Driver Manager supports two ODBC environment attributes: </a>SQL_ATTR_APP_UNICODE_TYPE and SQL_ATTR_DRIVER_UNICODE_TYPE, each with possible values of SQL_DD_CP_UTF8 and SQL_DD_CP_UTF16. The default value is SQL_DD_CP_UTF8. </div> <div class="Body"><a name="106452">The Driver Manager performs the following steps before actually connecting to the driver.</a></div> <div class="list_procedure_first_outer" style="margin-left: 0pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_first_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">1 </span> </div> </td> <td width="100%"> <div class="list_procedure_first_inner"><a name="106453">Determine the application Unicode type: Applications that use UTF-16 encoding for </a>their string types need to set SQL_ATTR_APP_UNICODE_TYPE accordingly before connecting to any driver. When the Driver Manager reads this attribute, it expects all string arguments to the ODBC "W" functions to be in the specified Unicode format. This attribute also indicates how the SQL_C_WCHAR buffers must be encoded.</div> </td> </tr> </table> </div> <div class="list_procedure_outer" style="margin-left: 0pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">2 </span> </div> </td> <td width="100%"> <div class="list_procedure_inner"><a name="106454"> </a> Determine the driver Unicode type: The Driver Manager must determine through which Unicode encoding the driver supports its "W" functions. This is done as follows:</div> </td> </tr> </table> </div> <div class="list_procedure_sub_first_outer" style="margin-left: 18pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_sub_first_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">a </span> </div> </td> <td width="100%"> <div class="list_procedure_sub_first_inner"><a name="106455">SQLGetEnvAttr(SQL_ATTR_DRIVER_UNICODE_TYPE) is called in the driver by </a>the Driver Manager. The driver, if capable, returns either SQL_DD_CP_UTF16 or SQL_DD_CP_UTF8 to indicate to the Driver Manager which encoding it expects.</div> </td> </tr> </table> </div> <div class="list_procedure_sub_outer" style="margin-left: 18pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_sub_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">b </span> </div> </td> <td width="100%"> <div class="list_procedure_sub_inner"><a name="106456">If the preceding call to SQLGetEnvAttr fails, the Driver Manager looks either in the </a>Data Source section of the odbc.ini specified by the connection string or in the connection string itself for a connection option named DriverUnicodeType. Valid values for this option are 1 (UTF-16) or 2 (UTF-8). The Driver Manager assumes that the Unicode encoding of the driver corresponds to the value specified.</div> </td> </tr> </table> </div> <div class="list_procedure_sub_outer" style="margin-left: 18pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_sub_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">c </span> </div> </td> <td width="100%"> <div class="list_procedure_sub_inner"><a name="106457">If neither of the preceding attempts are successful, the Driver Manager assumes </a>that the Unicode encoding of the driver is UTF-8.</div> </td> </tr> </table> </div> <div class="list_procedure_outer" style="margin-left: 0pt;"> <table border="0" cellspacing="0" cellpadding="0" summary=""> <tr style="vertical-align: baseline;"> <td> <div class="list_procedure_inner" style="width: 18pt; white-space: nowrap;"> <span class="Numbers">3 </span> </div> </td> <td width="100%"> <div class="list_procedure_inner"><a name="106458">Determine if the driver supports SQL_ATTR_WCHAR_TYPE: SQLSetConnectAttr </a>(SQL_ATTR_WCHAR_TYPE, <span class="Emphasis">x</span>) is called in the driver by the Driver Manager, where <span class="Emphasis">x</span> is either SQL_DD_CP_UTF8 or SQL_DD_CP_UTF16, depending on the value of the SQL_ATTR_APP_UNICODE_TYPE environment setting. If the driver returns any error on this call to SQLSetConnectAttr, the Driver Manager assumes that the driver does not support this connection attribute. </div> </td> </tr> </table> </div> <div class="Body_Indent"><a name="106459">If an error occurs, the Driver Manager returns a warning. The Driver Manager does not </a>convert all bound parameter data from the application Unicode type to the driver Unicode type specified by SQL_ATTR_DRIVER_UNICODE_TYPE. Neither does it convert all data bound as SQL_C_WCHAR to the application Unicode type specified by SQL_ATTR_APP_UNICODE_TYPE. </div> <div class="Body"><a name="106460">Based on the information it has gathered prior to connection, the Driver Manager either </a>does not have to convert function calls, or, before calling the driver, it converts to either UTF-8 or UTF-16 all string arguments to calls to the ODBC "W" functions.</div> <div class="Body"><a name="106468">References:</a></div> <div class="Body"><span class="Emphasis"><a name="106469">Java Internationalization: An Overview</a></span>, John Oâ??Connor, <span class="Cross_ref_"><a href="http://java.sun.com/developer/technicalArticles/Intl/IntlIntro/" target="external_window">http://java.sun.com/developer/technicalArticles/Intl/IntlIntro/</a></span></div> <div class="Body"><span class="Emphasis"><a name="106471">Unicode Support in the Solaris Operating Environment</a></span>, May 2000, Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303-4900</div> <div class="Body"><a name="106056"> </a></div> <script type="text/javascript" language="JavaScript1.2"> <!-- // Clear related topics // WWHClearRelatedTopics(); document.writeln(WWHRelatedTopicsInlineHTML()); // --> </script> </blockquote> <script type="text/javascript" language="JavaScript1.2"> <!-- document.write(WWHRelatedTopicsDivTag() + WWHPopupDivTag() + WWHALinksDivTag()); // --> </script> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de