Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: unicode issues on Unix only

by graff (Chancellor)
on Nov 07, 2013 at 03:19 UTC ( #1061519=note: print w/replies, xml ) Need Help??

in reply to unicode issues on Unix only

When I downloaded your sample data files, I noticed that "map2.txt" has CRLF line termination, while "greekwords1.txt" does not. Because of that, using chomp on osx/linux/unix doesn't do everything you want it to when you read the map file.

Try using s/\s+$//; instead of chomp.

(Curiously, when I first ran your script as-is on osx, with chomp, I didn't get "gobblede-gook" - I got nulls. But when I switched to removing all final white space, I got Greek.)

Replies are listed 'Best First'.
Re^2: unicode issues on Unix only
by Anonymous Monk on Nov 07, 2013 at 18:58 UTC
    Thanks, the line-ending issue was the cause of the problem.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1061519]
[erix]: my attention being jealously guarded ;)
[shmem]: erix, yes, it's a WTF. Since...
[erix]: antisemitic && (pro-)russian. Makes sense :P
[shmem]: erix: what's antisemitic in there? Tell me.
[erix]: AngloZionist
[shmem]: and it is *not* pro-russian. It describes the western world.
[erix]: I'm not going to read it so I could be mistaken but it reeks of useful idiocy
[shmem]: AngloZionist is not an antisemitic term.
[shmem]: erix: be assured that we all are horribly mistaken, always. What would we write tests for, if not for that fact?
[shmem]: and then, audiatur et altera pars.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-03-19 20:55 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.