Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Database Problem

by John M. Dlugosz (Monsignor)
on May 20, 2011 at 19:55 UTC ( #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.


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://905961]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-12-27 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (176 votes), past polls