What's new

Nano charset

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Meshkoff

Occasional Visitor
Hi all
How can i configure nano charset in merlin firmware?
I'm asking this question because it shows me strange symbols and questions marks insteаd Russian letters
For example, this string in nano on my OSX:
Code:
Доброе утро страна!
Turns into this on my router:
Code:
�^tоб�^`ое �^c�^b�^`о �^a�^b�^`ана

I think set UTF-8 encoding in routers nano to solve my problem, but cant find config file...
 
Does this only happen in nano or does it happen using the command line or another editor like vi?

What does this produce?
Code:
# echo $LANG $LC_ALL
en_US.UTF-8 en_US.UTF-8

If the code above only returns a blank line then you need to create a /jffs/configs/profile.add file as follows:
Code:
export LANG='ru_RU.UTF-8'
export LC_ALL='ru_RU.UTF-8'
If that doesn't work try this:
Code:
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
Remember that you need to log off and on again to test the changes.
 
Last edited:
ColinTaylor

Command line - ok

vi - says "'�'is not implemented", but if i start typing english letters first, and then type russian its ok, but it adds additional spaces after each russian letter, like this:
Code:
test test test т е с т  т е с т  т е с т

Sorry, but i don't get it right, do i need write this code to a script file and then run it?
If i just type this in command line it says nothing
 
As an experiment just type the following on the command line and then try nano again.
Code:
export LC_ALL='en_US.UTF-8'
 
Make sure the issue isn't the charset used by your SSH client.
 
ColinTaylor
Unfortunately, the same...
But now it at least answers me like that:
Code:
# echo $LANG $LC_ALL
en_US.UTF-8 en_US.UTF-8

RMerlin
I tried default terminal app and iterm
I Googled and found location of ssh config file (/etc/ssh), but there is no such parameter like charset or encoding
Or did you mean whole OSX locale?
 
I don't use a Mac but if you drop the OSX command line and type "locale" does it give you anything?
 
I confirm the same behavior on my AX88U with 384.17. I never noticed this till today as I didn't need to write in Cyrillic in nano.

In terminal command line - everything is OK
In Nano - the same as @Meshkoff says
In Vi - the same as @Meshkoff says
Used Putty from Windows 10 laptop as SSH client

Nano on my Ubuntu server 18.04.4 LTS works fine under the same scenario.
 
Last edited:
I don't use a Mac but if you drop the OSX command line and type "locale" does it give you anything?

Code:
LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL="ru_RU.UTF-8"

netware5
Seems like it nano version bug, i googled and solutions be like rebuilding nano from scratch with cyrillic letters support, but my OSX nano version is 2.0.6 and firmware nano version is 4.8, very strange...
Ok, will edit scripts on local folder and transfer it by scp command, or mount router folder inside finder, not a big deal)
 
Code:
LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL="ru_RU.UTF-8"

netware5
Seems like it nano version bug, i googled and solutions be like rebuilding nano from scratch with cyrillic letters support, but my OSX nano version is 2.0.6 and firmware nano version is 4.8, very strange...
Ok, will edit scripts on local folder and transfer it by scp command, or mount router folder inside finder, not a big deal)

Router FW nano is 4.9.2 - have problem
Ubuntu 18.04.4 LTS nano is 2.9.3 - no problem
FreeBSD 12.1 nano is 4.9.2 - no problem

All above has been tested with Putty from Windows 10. All settings on client and 3 different servers are default.

So that means the FW nano has a bug.
 
I don't believe this is a nano problem specifically. As far as I can see nano uses the locale setting LC_ALL. My guess is that the router's firmware isn't compiled with the Russian locale. Interestingly the Entware 'locales' package does include ru_RU.
 
I don't believe this is a nano problem specifically. As far as I can see nano uses the locale setting LC_ALL. My guess is that the router's firmware isn't compiled with the Russian locale. Interestingly the Entware 'locales' package does include ru_RU.

Here are the outputs from
Code:
echo $LANG $LC_ALL

Router FW:
Code:
ASUSWRT-Merlin RT-AX88U 384.17_0 Sun Apr 26 02:29:04 UTC 2020
admin@Router:/tmp/home/root# echo $LANG $LC_ALL
en_US.UTF-8 en_US.UTF-8
admin@Router:/tmp/home/root#

Ubuntu Server 18.04.4 LTS:
Code:
Last login: Sun Jun  7 19:08:33 2020 from 192.168.77.56
pendgy@OpenVPNGate:~$ echo $LANG $LC_ALL
en_US.UTF-8

FreeBSD 12.1 (my NAS OS is FreeBSD based):
Code:
Welcome to XigmaNAS!
fileserver: ~# echo $LANG $LC_ALL
LC_ALL: Undefined variable.

As I already mentioned all language settings are default. I never faced yet a need to play with locales on my *nix machines in order to be able to write in Cyrillic. The default EN_US were fine so far. So definitely the FW nano is wrongly compiled.
 
In order to keep the footprint down, nano is built with the '--disable-nls' flag.....not sure how much space that saves.

So that means we should install Entware nano in order to be able to write in Cyrillic?
 
Similar threads
Thread starter Title Forum Replies Date
P In Asuswrt, how to display the log timestamp with nano seconds? Asuswrt-Merlin 6

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top