in reply to Re^2: Character encoding fun...
in thread Character encoding fun...
If $my_utf_data really contains bytes, no character in that string should be > 255. The error message you are getting indicates that there are characters > 255 in your string.
If $my_utf_data is really text (i.e. consists of code points), then all you need is the call to encode to get a cp1252 encoded stream of bytes:
encode('cp1252', $my_utf_data)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Character encoding fun...
by joem (Initiate) on Nov 15, 2007 at 21:02 UTC | |
by graff (Chancellor) on Nov 16, 2007 at 02:54 UTC |