Problems with nano and swedish characters like å, ä and ö.

ralphot

Member
Credits
253
I wonder, what could be the problem, when I use swedish characters in nano (ubuntu 18.04) everything goes crazy. In the picture, I have two identical lines, on the first line I place my marker over the first ö and types an a.
All the other ö there disappears replaced by a ? and the cursor goes away to the right many places as you see on the picture. Very odd.
What can be the problem. Difficult to edit swedish text as you can understand.
Also this: "skapa ta?^hvlingar ma?^jste" --- is really ---"skapa tävlingar måste"
 

Attachments



captain-sensible

Well-Known Member
Credits
12,989
some people i don't know why use vim to code html ; it wouldn't be my first choice nor nano. Isn't that a html or maybe php file with html that your showing to edit ?
 

ralphot

Member
Credits
253
What do you suggest to use for editor on a remote server in another city? Its not my own server I could equip with KDE and Kate or whatever. It's a serverpark remote server that I connect to with ssh through terminal. What's the alternative??
 

ralphot

Member
Credits
253
vim because it's installed on most Linux distributions by default.
Which terminal are you using? The default one?
I'm using terminal in mac and it works perfect with nano on the mac itself and a local server here
But ssh into a remote server the national characters are all screwed up, in Vim:
dig sja?~Hlv under insta?~Hllningar fo?~Hr ditt konto. Va?~Hl inloggad it's å, ä and ö that's garbled.
Check preferences and make sure it's UTF-8 in the compatibility tab.
See above
 

Attachments

ralphot

Member
Credits
253
My hunch is that it's a locale issue.
It might be, in my macbook:
LANG="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_CTYPE="sv_SE.UTF-8"
LC_MESSAGES="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_ALL=

In my ubuntu (local) server:
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

In the problematic server:
LANG=en_US
LANGUAGE=en_US:
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

So, how do I change that?
 

KGIII

Super Moderator
Staff member
Gold Supporter
Credits
21,822
I am not 100% sure how to fix it. I only use English. If I type in Spanish, I can do so because of my keyboard layout and it's never for any system functions.

I did find this for you:

 

ralphot

Member
Credits
253
Solved! I did this command:

export LC_ALL=sv_SE.utf8

and that seemed to fix it.

So now locale is: (and nano works fine with åäö)

LANG=en_US
LANGUAGE=en_US:
LC_CTYPE="sv_SE.utf8"
LC_NUMERIC="sv_SE.utf8"
LC_TIME="sv_SE.utf8"
LC_COLLATE="sv_SE.utf8"
LC_MONETARY="sv_SE.utf8"
LC_MESSAGES="sv_SE.utf8"
LC_PAPER="sv_SE.utf8"
LC_NAME="sv_SE.utf8"
LC_ADDRESS="sv_SE.utf8"
LC_TELEPHONE="sv_SE.utf8"
LC_MEASUREMENT="sv_SE.utf8"
LC_IDENTIFICATION="sv_SE.utf8"
LC_ALL=sv_SE.utf8

Thank you all! Have a nice day :)
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top