Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Jim (Curate)
on Jun 22, 2014 at 19:05 UTC ( #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 (Pope) 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 (Pope) 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
Node Status?
node history
Node Type: note [id://1090843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-08-21 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (204 votes). Check out past polls.

    Notices?