Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a rar file. After extraction, it generates a file with Chinese name which is shown in Nautilus as:

��������ѧ.������.����������ѧ������.2008.djvu (invalid encoding)

In terminal it is shown as:

<BD><FC><B4><FA><D7><E9><BA><CF>ѧ.<CD><F5><CC><EC><C3><F7>.<B4><F3><C1><AC><C0><U+DE64><B4><F3>ѧ<B3><F6><B0><E6><C9><E7>.2008.djvu

The content of the rar file listed by unrar is correct:

$ unrar l 近代组合学.王天明.大连理工大学出版 社.2008.rar    
UNRAR 3.93 freeware      Copyright (c) 1993-2010 Alexander Roshal    
Archive 近代组合学.王天明.大连理工大学出版社.2008.rar    
 Name             Size   Packed Ratio  Date   Time     Attr      CRC   Meth Ver
-------------------------------------------------------------------------------
 近代组合学.王天明.大连理工大学出版社.2008.djvu  6190416  6187189  99% 03-06-11 10:33  .....A.   98320D40 m3g 2.9
-------------------------------------------------------------------------------
    1          6190416  6187189  99%

The file cannot be open unless I change its name to be something like 1.djvu.

I was wondering why the characters are not shown properly with Chinese name of compressed file, while I can create a directory or file with Chinese name?

How shall I do?

Thanks and regards!

share|improve this question
    
Does it show up properly in a terminal? Open a terminal, navigate to the directory using cd path/to/dir and list the directory using ls –  Lekensteyn Jun 10 '11 at 20:14
    
Thanks! No, it isn't. See my update. –  Tim Jun 10 '11 at 20:17
    
Strange, I can't make any useful encoding out of it. Could you run: unrar l path/to/archive.rar? –  Lekensteyn Jun 10 '11 at 20:27
    
The filename seems to be broken, or maybe I'm doing something wrong. All I can get out of it is the beginning: 輪測玃磁\x04g卼毞隴.湮蟀餐. This is the big5hkscs (aka big5-hkscs, hkscs) Traditional Chinese encoding. Does it make sense? –  Stefano Palazzo Jun 10 '11 at 20:34
    
@Lekensteyn: I have updated my post with listing the content of the file. –  Tim Jun 10 '11 at 20:38
show 1 more comment

3 Answers

up vote 4 down vote accepted

Perhaps the graphical archive program does not understand Chinese. Try extracting the archive using the command-line:

  1. Open a terminal.
  2. Navigate to the directory containing the file:

    cd /path/to/directory/
    

    You can use the Tab key to complete filenames and directory names. Double press Tab to get a list of possible completions in case there is more than one option.

  3. Run the unrar program to unpack filename.rar:

    unrar x filename.rar
    

    Here, you can use tab-completion too for the filename.

  4. The contents of the archive will be visible in the current directory.
share|improve this answer
    
Thanks! That solves the problem. But how can I make the GUI recognize Chinese encodings? –  Tim Jun 10 '11 at 20:54
    
What is the archive manager called? –  Lekensteyn Jun 10 '11 at 20:58
    
File Roller 2.32.0 –  Tim Jun 10 '11 at 21:01
    
Great. It works for me. –  Shen Feb 22 '12 at 1:16
    
Doesn't work for me... –  int_ua May 18 '12 at 16:59
add comment

Looks like the filename usres a different character encoding than your environment. The character ѧ (CYRILLIC SMALL LETTER LITTLE YUS) is most likely not part of a Chinese file name.

Do you have any information about the operating system and language settings the file has been created in? Do you know which character encodings are common to encode Chinese file names?

If you know the filenames's encoding you can use convmv (not installed by default) to convert it to the encoding you use (most likely UTF-8).

share|improve this answer
    
Thanks! I guess it was created in Windows. From Wikipedia, the Chinese encodings are Chinese Guobiao: GB 2312, GBK (Microsoft Code page 936), and GB 18030. –  Tim Jun 10 '11 at 20:48
add comment

try this:

unrar --enable-charset x $1
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.