I have a telegram bot that takes a string (japanese or spanish) and translate it using Google Translate's scraper (this one https://github.com/statickidz/node-google-translate-free).
I tested it on Mac and works fine. But when I'm trying to deploy it on my VPS (Debian 8.3), it doesn't return japanese characters.
All I get, in Telegram and terminal, is this:
�����ɂ���'
Must be a charcode failure, but it seems UTF-8 in both sides...
UPDATE
My code for output is this:
sakura.onText(/\/esp (.+)/, function (msg, match) {
var fromId = msg.from.id;
var input = match[1];
translate({ text: input, source: 'es', target: 'ja' }, function(result) { sakura.sendMessage(fromId, "'" + input + "', traducido, significa '" + result + "'."); });
});
I've tested with japanese locales
for Debian. Linux output are in japanese, but not my bot's output.
Solved using iconv
for UTF-8 encode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With