Encoding / decoding UTF8 in javascript
function encode_utf8( s )Tested and working like a charm in these browsers:
{
return unescape( encodeURIComponent( s ) );
}
function decode_utf8( s )
{
return decodeURIComponent( escape( s ) );
}
- Win32
- Firefox 1.5.0.6
- Firefox 1.5.0.4
- Internet Explorer 6.0.2900.2180
- Opera 9.0.8502
- MacOS
- Camino 2006061318 (1.0.2)
- Firefox 1.5.0.4
- Safari 2.0.4 (419.3)
And if you hand me your platform/browser combination and the its success/failure status for the tests, I'll try to update the post accordingly.











Nifty!