You are not logged in.

#1 2012-04-01 01:49:17

feilong2k
Member
Registered: 2012-04-01
Posts: 6

[SOLVED] Naming files in Chinese without having to change system local

Hello everyone I'm very new to Arch linux, and loving it so far.

I need to be able to name files in Chinese characters, but it is giving me a invalid filename error. However i do not want to change the system locale as that changes all the menu into Chinese as well, preferr them in English. How can this be done?

Thank you for the help

Last edited by feilong2k (2012-04-02 21:51:36)

Offline

#2 2012-04-01 03:06:35

ingolemo
Member
Registered: 2012-02-16
Posts: 12

Re: [SOLVED] Naming files in Chinese without having to change system local

What locale are you currently using?

Offline

#3 2012-04-01 07:35:27

Blµb
Member
Registered: 2008-02-10
Posts: 224

Re: [SOLVED] Naming files in Chinese without having to change system local

Rather: What filesystem are you working on? ntfs for example has an 'utf8' mount option, jfs has an 'isocharset=' option.
If you use an UTF-8 locale, then you need to make sure the filesystem supports utf8 and is mounted so that it allows it.


You know you're paranoid when you start thinking random letters while typing a password.
A good post about vim
Python has no multithreading.

Offline

#4 2012-04-01 20:06:20

feilong2k
Member
Registered: 2012-04-01
Posts: 6

Re: [SOLVED] Naming files in Chinese without having to change system local

the filesystem I'm using is ext4, locale is the default one from Arch linux for Canada. Does this mean if I mount an external HD that's in NTFS I should be able to save documents in Chinese? I will try this out a bit later and post back.

Thank you for the help

Offline

#5 2012-04-02 02:36:50

feilong2k
Member
Registered: 2012-04-01
Posts: 6

Re: [SOLVED] Naming files in Chinese without having to change system local

I mounted a NTFS drive and tried renaming a file in chinese characters still getting the same error. Any other suggestions?

Any help is appreciated. Thank you

Offline

#6 2012-04-02 14:54:33

ingolemo
Member
Registered: 2012-02-16
Posts: 12

Re: [SOLVED] Naming files in Chinese without having to change system local

Canada has four different possible locales.

Let me ask the same question in a different way; what do you get when you type this into the terminal?

echo $LANG

Offline

#7 2012-04-02 18:14:08

feilong2k
Member
Registered: 2012-04-01
Posts: 6

Re: [SOLVED] Naming files in Chinese without having to change system local

when I type that into the terminal I am getting a blank result. Is that normal?

Offline

#8 2012-04-02 19:29:17

ingolemo
Member
Registered: 2012-02-16
Posts: 12

Re: [SOLVED] Naming files in Chinese without having to change system local

No, it should give you something like "en_CA.UTF-8". It sounds like your locale is misconfigured.

What locales did you uncomment in "/etc/locale.gen"?
What is the value of "LOCALE" in "/etc/rc.conf"?
What do you get when you run "locale -a"?

Offline

#9 2012-04-02 20:05:52

feilong2k
Member
Registered: 2012-04-01
Posts: 6

Re: [SOLVED] Naming files in Chinese without having to change system local

I uncommented the following in the /etc/locale.gen file:
en_US.utf8
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

LOCALE in /etc/rc.conf is blank

when I run locale -a I get the following

C
POSIX
en_US.utf8
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

Offline

#10 2012-04-02 20:25:30

ingolemo
Member
Registered: 2012-02-16
Posts: 12

Re: [SOLVED] Naming files in Chinese without having to change system local

Set LOCALE in "/etc/rc.conf" to "en_US.UTF-8" and reboot. That should solve your problem.

If you're in Canada then you may prefer to set it to "en_CA.UTF-8", but you'll have to uncomment it in "/etc/locale.gen" and run "locale-gen" as root before it will work. For compatibility's sake you should probably also uncomment "en.US" (and/or "en.CA").

Offline

#11 2012-04-02 21:42:01

feilong2k
Member
Registered: 2012-04-01
Posts: 6

Re: [SOLVED] Naming files in Chinese without having to change system local

Thank you very much ingolemo, it is working now. really appreciate the help!

Offline

Board footer

Powered by FluxBB