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

Re: Korean characters messing with all scripts

by Anonymous Monk
on Dec 05, 2016 at 09:14 UTC ( [id://1177202]=note: print w/replies, xml ) Need Help??


in reply to Korean characters messing with all scripts

Hey all, thanks for the responses . The reason I haven't posted data is because it's confidential and copy past functionality is not possible . Basically things fail when I am printing and a field has a character not recognized .. this leads to all kinds of carriage return errors and other weird outputs I can't understand when I print . How can I diagnose what type of text I'm using ? I don't have anyone tech savvy who can telll me.. so will have to figure out myself. 1) how to tell the type of encoding 2) how to edit to normal
  • Comment on Re: Korean characters messing with all scripts

Replies are listed 'Best First'.
Re^2: Korean characters messing with all scripts
by haukex (Archbishop) on Dec 05, 2016 at 09:32 UTC

    Hi,

    You don't need to post the real data, just an example that demonstrates the problem and lets us reproduce it. See How do I post a question effectively? and Short, Self Contained, Correct (Compatible) Example.

    Some general tips:

    • Look at the raw data in the file, e.g. hexdump -C FILENAME or od -Ax -tx1z FILENAME, and verify which character encoding is in use.
    • When opening the file, make sure to specify the correct encoding layer, e.g. open my $fh, '<:encoding(UTF-8)', $filename or die $!;
    • When inspecting the data in Perl, don't use print, use either use Data::Dumper; $Data::Dumper::Useqq=1; print Dumper($data);, use Data::Dump 'pp'; pp $data;, or for a really detailed look use Devel::Peek; Dump( $data );

    When explaining the problem here, post all three of the above, that is, a few lines of the hex dump, the code you're using, and the output of one of the dumper modules.

    Hope this helps,
    -- Hauke D

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-23 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found