Take the 2-minute tour ×

I am converting translation files to JSON in NodeJS.

I have strings like:

Cadrer sur la sélection
Navigateur dépassé détecté !

and I am trying to convert them to UTF-8 so I can json.stringify them.

However, I end up with string that look like:

Navigateur d�pass� d�tect� !

Below is a shorten example of my code ...

var obj = {};
    var iconv = new Iconv("ISO-8859-1", 'UTF-8');
    var buffer = iconv.convert(messages[i]); // the ISO-8859-1 str
    obj[i] = buffer.toString();
var jsonLocale = JSON.stringify(obj)

Thanks in advance!

share|improve this question
What language is this code in? What frameworks and application environment are you using? –  Jim DeLaHunt Nov 30 '12 at 7:25

Your Answer



Browse other questions tagged or ask your own question.