Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Problems with packing upper ASCII - differences across perl versions

by John M. Dlugosz (Monsignor)
on Nov 29, 2002 at 17:40 UTC ( #216567=note: print w/replies, xml ) Need Help??


in reply to Problems with packing upper ASCII - differences across perl versions

From the error in your reply, it looks like the input is not in UTF8 format at all, but an 8-bit character set. I think you are trying to escape out Latin-1. We covered this in a thread a couple days ago.

Your Unicode behavior is going to see bytes or chars in split, and that's what's different between 5.6 and 5.8.

Try using foreach my $char (unpack ("C*", $foo)) (I think that's the right unpack syntax) to force byte seperation of the input, regardless of how the string is tagged (byte or utf8). Then use the if statement you have now as the body of the loop.

  • Comment on Re: Problems with packing upper ASCII - differences across perl versions
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://216567]
help
Chatterbox?
[Corion]: Hmm - the longer I work, the more such sentences I collect:
[Corion]: "If I wanted to work with people, I would have become a coroner."
[Corion]: "If I wanted to work with hot air, I would have become a baloonist"
[Corion]: "If I wanted to work with flaps, I would have become a mailman"
[Corion]: (I'm not sure if the last one works in English too ;) )

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-09-21 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (248 votes). Check out past polls.

    Notices?