Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Database Problem

by John M. Dlugosz (Monsignor)
on May 20, 2011 at 13:31 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found