[Libguestfs] 【help】why not support showing filename containing chinese characters with the ls function?

Richard W.M. Jones rjones at redhat.com
Tue May 22 10:14:09 UTC 2012


On Tue, May 22, 2012 at 05:34:40PM +0800, 马磊 wrote:
> Hi,everyone:
>     As the subject says, why chinese characters are shown as '?' by using
> ls function?
>     Did anyone encounter the same problem and does resolution exist?
>     Looking forward to your reply. Thanks in advance.

I tried this, and it works for me:

  $ qemu-img create -f qcow2 -b /dev/vg_pin/F16x64 chinese-chars.img
  Formatting 'chinese-chars.img', fmt=qcow2 size=21474836480 backing_file='/dev/vg_pin/F16x64' encryption=off cluster_size=65536 
  $ guestfish -a chinese-chars.img -i touch "/马磊"
  $ guestfish --ro -a chinese-chars.img -i 
  
  Welcome to guestfish, the libguestfs filesystem interactive shell for
  editing virtual machine filesystems.
  
  Type: 'help' for help on commands
        'man' to read the manual
        'quit' to quit the shell
  
  Operating system: Fedora release 16 (Verne)
  /dev/mapper/vg_f16x64-lv_root mounted on /
  /dev/vda2 mounted on /boot
  
  ><fs> ls /
  bin
  boot
  dev
  etc
  home
  lib
  lib64
  lost+found
  media
  mnt
  opt
  proc
  root
  run
  sbin
  selinux
  srv
  sys
  tmp
  usr
  var
  马磊
  ><fs> ll /
  total 126
  dr-xr-xr-x.  23 root root  4096 May 22 11:10 .
  drwxr-xr-x   23  500  500  4096 May 22 11:11 ..
  dr-xr-xr-x.   2 root root  4096 Mar  6 11:18 bin
  dr-xr-xr-x.   6 root root  1024 Jan 25 09:47 boot
  drwxr-xr-x.   5 root root  4096 Aug 16  2011 dev
  drwxr-xr-x. 135 root root 12288 Apr 18 13:40 etc
  drwxr-xr-x.   3 root root  4096 Jul 29  2011 home
  dr-xr-xr-x.  11 root root  4096 Nov 28 15:19 lib
  dr-xr-xr-x.  11 root root 12288 Mar  6 11:18 lib64
  drwx------.   2 root root 16384 Aug 16  2011 lost+found
  drwxr-xr-x.   2 root root  4096 Jun 29  2011 media
  drwxr-xr-x.   4 root root  4096 Nov 28 14:22 mnt
  drwxr-xr-x.   2 root root  4096 Jul 29  2011 opt
  drwxrwxr-x    2 root root  4096 Aug 16  2011 proc
  dr-xr-x---.   6 root root  4096 Nov 25 08:44 root
  drwxr-xr-x.  21 root root  4096 Aug 16  2011 run
  dr-xr-xr-x.   2 root root 12288 Mar  6 11:18 sbin
  drwxr-xr-x    3 root root  4096 Jun 29  2011 selinux
  drwxr-xr-x.   2 root root  4096 Jul 29  2011 srv
  drwxrwxr-x.   2 root root  4096 Aug 16  2011 sys
  drwxrwxrwt.  10 root root  4096 Apr 18 13:40 tmp
  drwxr-xr-x.  13 root root  4096 Aug 28  2011 usr
  drwxr-xr-x.  18 root root  4096 Aug 28  2011 var
  -rw-r--r--    1 root root     0 May 22 11:10 马磊

What are your language settings, eg. the locale and the environment
variables $LANG etc?  You can find out by running the 'locale'
command:

  $ locale
  LANG=en_GB.UTF-8
  LC_CTYPE="en_GB.UTF-8"
  LC_NUMERIC="en_GB.UTF-8"
  LC_TIME="en_GB.UTF-8"
  LC_COLLATE="en_GB.UTF-8"
  LC_MONETARY="en_GB.UTF-8"
  LC_MESSAGES="en_GB.UTF-8"
  LC_PAPER="en_GB.UTF-8"
  LC_NAME="en_GB.UTF-8"
  LC_ADDRESS="en_GB.UTF-8"
  LC_TELEPHONE="en_GB.UTF-8"
  LC_MEASUREMENT="en_GB.UTF-8"
  LC_IDENTIFICATION="en_GB.UTF-8"
  LC_ALL=

If you can reproduce this issue, please file a bug:

https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools

Thanks, Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora




More information about the Libguestfs mailing list