in reply to how to remove é
You've opened a can of worms. You need to read up on "unicode". The bottom line is that you need to know the "encoding" of any data you read from a file. An "encoding" tells perl how many bytes each integer in your file occupies. Remember computers store characters as integers.
Here's an example. Suppose these bytes are in your file:
0000 0001 0000 1000
If you tell perl that your file is encoded in such a way that the first integer occupies 1 byte, then perl will read the following for the first integer:
0000 0001
which is equivalent to 1 in decimal. However, if you tell perl that your file is encoded in such a way that the first integer occupies 2 bytes, then perl will read the following for the first integer:
0000 0001 0000 1000
which is equivalent to 8 + 256 = 264 in decimal. So depending on what encoding you specify, perl will read in a different integer(and again remember that the integers are just codes for characters).
By the way, \015 is not the special character ^r (up arrow+r). \015 is the octal syntax for the decimal integer 13, which is the ascii code for a carriage return. The fact that you tried to remove them from a file is very suspect. Please explain why you were doing that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to remove é
by ZWcarp (Beadle) on Aug 07, 2013 at 20:10 UTC |