Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: newline for Unicode?

by ahunter (Monk)
on Jun 16, 2000 at 23:39 UTC ( #18537=note: print w/replies, xml ) Need Help??


in reply to newline for Unicode?

All Unicode characters are 16 bits wide (well, not strictly true...), but have a large variety of encodings. In UTF-8, for instance, the ASCII characters are encoded exactly the same way, so newline is, er, \n. UTF-7 is just plain silly, and UTF-16 is 16-bits wide, so newline would be \0\n.

(Note that the first 256 characters of Unicode are the ISO-8859-1, character set, better known as Latin-1. The first 128 are ASCII)

There again, in NT, text files are plain 8-bit ASCII (with the top-bit set characters being some godawful M$ encoding), so \r\n should indeed do the trick, unless you really are using some form of Unicode editor & file format. (Perl was written for Unix, where newline is just \n, but NT considers newline to be \r\n. Actually, only notepad seems to think that these days...)

Andrew.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://18537]
help
Chatterbox?
[stevieb]: I just received full professional license for ALL of JetBrains software due to requesting their opensource request form! I wanted only CLion, but they give them all
[stevieb]: I stated I use IDEA for Perl work, and at work, licensed version of PyCharm
[beech]: is that a good thing?
[stevieb]: absolutely. Free professional IDEs and related software for all the langs I write in, and I wanted CLion because it's a C IDE that can communicate directly with an Arduino

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-02-20 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (302 votes). Check out past polls.