Ubuntu – UTF-8 Issue, don’t know where

localenodejssambaserverutf-8

I am running a node.js server and the following line just isn't working.

console.log("☺☻♥ مرحبا 你好");

I opened up the file in nano and cat on my ubuntu server 14.04 (no gui, no window manager, no kde, no gtk, no nothing, pure ubuntu server 14.04) and it looks like this:

nano

I have the file in a samba share and when I open it in Windows 8 pro it looks as so in notepad++:

notepad++

notepad++ encoding

This is how the samba config looks like this, the private shares do not have anything fancy or to do with charsets:

samba

Locale looks as so:

enter image description here

/etc/default/locale looks like:

enter image description here

And the following command displays a Ô in the ubuntu server terminal:

perl -CO -le ‘print “\x{d4}”’

Like so:

enter image description here

I use the command start_unicode and then hold in ALT while typing 1236 and got a diamond!

I ran the following:

sudo touch /srv/file.txt
sudo bash -c 'echo -e "\xe2\x82\xac"' > /srv/file.txt

This resulted in a very nice € symbol in nano however when trying to display the following ☺☻♥ it does not work (black diamonds)

Anyone got any ideas?

Best Answer

Your LANGUAGE value is invalid. I really don't know, but possibly it confuses your system. Since you apparently don't want to use a language priority list anyway, you may want to drop the setting of LANGUAGE.

Related Question