in reply to Re^2: strange utf-8 (I think) behaviour...
in thread strange utf-8 (I think) behaviour...
Now, I remember reading somewhere that decoding in Perl was actually the same as encoding in utf-8Not true.
use strict; use warnings; use utf8; use Encode qw(encode_utf8); binmode STDOUT, ':encoding(UTF-8)'; my $s = "sämple\n"; print uc $s; print uc encode_utf8($s); __END__ Output: SÄMPLE SäMPLE
Note that the use utf8; implicitly decodes string constants in this program.
is it as simple as decoding each element individually before using it?
Yes.
Would I then need to re-encode it or should setting the charset in the content type for the email be sufficient?
You should give your decoded string to a module that does the encoding for you. No need to re-invent the wheel.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: strange utf-8 (I think) behaviour...
by seekay (Initiate) on Oct 24, 2008 at 02:11 UTC |