I might possibly have not expressed correctly. The first value that should be used is: 'Köln'
;) Thats the exact value I used, all of the values produced by encode/decode in my program are exactly 'Köln', the latin1 and binary version and the utf8 version, they're all 'Köln'
When Perl tells me, that the length is 5, then this is in my eyes not correct iso-8859-1 because in this case it should be only 4 characters.... say Dumper "========== encode string ==========";
Why are you looking at "length" at all?
You start with unknown bytes (either utf8 or latin1), perl treats it as bytes or latin1, whether its 4 or 5, it doesn't matter, its not a "unicode string" its a binary string or a latin1 string
Then you encode this string to latin1 explicitly, now its bytes for sure, this time it makes no sense to look at length -- its the length of the bytes, whatever they are, since you don't know what you started with the new length doesn't matter
Also , if you're going to Dumper anything it should be data, not banners
I/O flow (the actual 5 minute tutorial)
In reply to Re^3: possible missunderstanding of package Encode
by Anonymous Monk
in thread possible missunderstanding of package Encode
by toohoo
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |