note
afoken
<p>If you mean Unicode with "Asian character", make sure every component knows that you are using Unicode. Perl should set the utf8-Flag on all strings containing Unicode, the DBI driver should know that your data may contain Unicode both while storing and while fetching, and your database should know that as well.</p>
<ul>
<li>DBD::Pg has the <a href="http://search.cpan.org/~turnstep/DBD-Pg-2.13.1/Pg.pm#pg_enable_utf8_(boolean)">pg_enable_utf8</a> connect attribute</li>
<li>DBD::ODBC must be <a href="http://search.cpan.org/~mjevans/DBD-ODBC-1.22/ODBC.pm#Unicode">compiled to support Unicode</a> (default on on Win32, default off on any other platform)</li>
<li>DBD::Oracle needs <a href="http://search.cpan.org/~pythian/DBD-Oracle-1.23/Oracle.pm#Unicode">Environment variables</a> (NLS_NCHAR=AL32UTF8) and at least Oracle 9.2</li>
<li>DBD::mysql has <a href="http://search.cpan.org/~capttofu/DBD-mysql-4.011/lib/DBD/mysql.pm#DATABASE_HANDLES">mysql_enable_utf8</a></li>
</ul>
<p>The Unicode setup of the database is very different from RDBMS to RDBMS. Oracle and PostgreSQL store Unicode in any CHAR or VARCHAR/VARCHAR2, MS SQL Server needs NVARCHAR or NCHAR instead of VARCHAR or CHAR, and MySQL -- I don't know. I prefer RDBMSes with less surprises.</p>
<p>See also the tests <a href="http://cpansearch.perl.org/src/MJEVANS/DBD-ODBC-1.22/t/40UnicodeRoundTrip.t">t/40UnicodeRoundTrip.t</a> and <a href="http://cpansearch.perl.org/src/MJEVANS/DBD-ODBC-1.22/t/41Unicode.t">t/41Unicode.t</a> in <a href="http://search.cpan.org/dist/DBD-ODBC/">DBD::ODBC</a></p>
<p>Alexander</p>
<div class="pmsig"><div class="pmsig-747201">
--<br>
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
</div></div>
731442
731442