Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: A puzzled garbage character issues by use Perl-DBI

by afoken (Parson)
on Jun 17, 2009 at 12:18 UTC ( #772361=note: print w/ replies, xml ) Need Help??


in reply to A puzzled garbage character issues by use Perl-DBI

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.

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.

See also the tests t/40UnicodeRoundTrip.t and t/41Unicode.t in DBD::ODBC

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)


Comment on Re: A puzzled garbage character issues by use Perl-DBI
Re^2: A puzzled garbage character issues by use Perl-DBI
by pysome (Scribe) on Jun 18, 2009 at 02:31 UTC
    Thank you very much.

    Now the core of problem is that the garbage display by using
    method two. I means only some little character is garbage and
    other remained characters still display normally .
    Database is MSSQL and the column is varchar(8000) type.
    (in order to store Asain HTML's content) Regards

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://772361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-07-30 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls