Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Database Problem

by John M. Dlugosz (Monsignor)
on May 20, 2011 at 19:55 UTC ( [id://905961]=note: print w/replies, xml ) Need Help??


in reply to Database Problem

I think there are two separate places in the code path where encoding was wrong or transcoding got performed wrong. Once where you read the original content and stuffed it into Perl strings, and again when transforming that to printable output which introduced some extra '?' but otherwise kept the bytes the same.

You might try Code Page 936 or "GBK" for your original data, not UTF-8.

Again, printing the raw data you got from the source database as hex, with no further processing, would help. You can also print the raw bytes to a file, and try loading that file into a text editor with different encodings specified and see which one makes sense. You need to read Chinese to know when it "makes sense" though. Does “脭忙脛戮鹿碌” look like the correct content? It's all valid simplified Chinese characters, but it doesn't appear to make any sense out of context.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found