Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^7: Default encoding rules leave me puzzled...

by Jim (Curate)
on Jun 22, 2014 at 19:05 UTC ( [id://1090843]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Default encoding rules leave me puzzled...
in thread Default encoding rules leave me puzzled...

What output does that Perl command-line script produce?

C:\>chcp Active code page: 437 C:\>perl -MScalar::Util=looks_like_number -wE "use utf8; say looks_lik +e_number('ç')? 'yes' : 'no'" no C:\>bash $ perl -MScalar::Util=looks_like_number -wE 'use utf8; say looks_like_ +number("ç") ? "yes" : "no"' Malformed UTF-8 character (1 byte, need 3, after start byte 0xe7) at - +e line 1. no $ exit C:\>

By posting a command-line script and then not posting the output it produces, you've made no useful point—at least not one that's immediately understandable.

Replies are listed 'Best First'.
Re^8: Default encoding rules leave me puzzled...
by ikegami (Patriarch) on Jun 25, 2014 at 17:31 UTC

    If you saw ç in a console set to cp437, you didn't actually have ç in the script because the code is treated as being UTF-8.

    Other than properly encoding the ç, you can address that issue by replacing ç with chr(0xE7). It will still output no.

Re^8: Default encoding rules leave me puzzled...
by ikegami (Patriarch) on Jun 25, 2014 at 17:32 UTC

    If you saw ç in a console set to cp437, you didn't actually have ç in the script because the code is treated as being UTF-8.

    Other than properly encoding the ç, you can address that issue by replacing ç with chr(0xE7). It will still output no.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-16 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found