Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Database Problem

by John M. Dlugosz (Monsignor)
on May 20, 2011 at 13:31 UTC ( #905919=note: print w/ replies, xml ) Need Help??


in reply to Database Problem

Show the hex codes of the strings you are getting from the database. Then I might be able to identify the correct code page for you.

Or you can take a guess, perhaps Windows-1252 or whatever is normal for your part of the world. Use the Encoding module to process the string from the database.

Or maybe it is indeed UTF8 as you thought, but is coming through as individual bytes. The Encoding module will take care of that too: decode UTF8, rather than transferring the bytes directly to a Perl string. Just because it is UTF-8 data doesn't mean the string is "marked" properly by the database implementation; it could just be treating it as a string of individual bytes. Then Perl thinks it is a legacy 8-bit string and sees each byte of the multi-byte UTF-8 character as a separate character.

óJohn


Comment on Re: Database Problem

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-12-26 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls