# How to display Chinese characters in UXTerm&vi?



## alphachi (Mar 22, 2010)

Hello everybody! I meet a puzzled problem.

*Current Environment*
FreeBSD 8.0 Release: Standard Installation
xorg-minimal-7.4_4: Port Installation
xterm-253: Port Installation
dwm-5.7.2: Port Installation
wqy-fonts-28801102,1: Port Installation (chinese fonts supporting ISO10646-1; have fonts.dir)

*/etc/X11/xorg.conf*

```
...
Section "Files"
        ModulePath  "/usr/local/lib/xorg/modules/"
        FontPath    "/usr/local/lib/X11/fonts/wqy/"
...
EndSection

Section "Module"
...
        Load "freetype"
...
EndSection
...
```

*~/.xinitrc*

```
exec /usr/local/bin/dwm
```

*~/.login_conf* (have using "cap_mkdb .login_conf")

```
me:\
  :charset=iso-10646-1:\
  :lang=zh_CN.ISO10646-1:
```

*~/UXTerm*

```
*VT100.font: -wenquanyi-wenquanyi bitmap song-bold-r-normal--13-130-75-75-p-80-iso10646-1
*VT100.utf8Fonts.font: -wenquanyi-wenquanyi bitmap song-bold-r-normal--13-130-75-75-p-80-iso10646-1
```

When I use "startx" enter dwm and press Alt+Shift+Enter to open UXTerm and input "ls ~", all files and directories named with Chinese characters display some "?": 



If I use vi to  open the file that including some Chinese characters, the interface is:


I changed to other wqy fonts supporting ISO10646-1 and the problem still existing.

I press Alt+Shift+Q to Quit and some error info display on console mode:

```
(EE) Failed to load module "freetype" (module does not exist, 0)
failed to set mttr: Device not configured
warning: no locale support
dwm: missing fontset: ISO8859-1
```

Reboot the computer, still ...

Need help, thanks!


----------



## alphachi (Mar 23, 2010)

This is the UXTerm interface after input "ls":





This is the vi interface including some Chinese characters:


----------



## miniqq (Mar 25, 2010)

xterm has support utf8
xterm default font 

```
xterm -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
```
that support unicode ,default size is 12.

if you want to use xft:

```
xterm*locale:           true
xterm*utf8Title:        true
xterm*menuLocale:       zh_CN.UTF-8
! TrueType font
XTerm*faceName: xft: Bitstream Vera Sans Mono:pixelsize=12
xterm*faceNameDoublesize: xft: Wenquanyi bitmap song:pixelsize=12
xterm*eightBitOutput:   true
xterm*eightBitInput:    true
xterm*eightBitSelectTypes: true
xterm*wideChars:        true
xterm*utf8:             1
```
put them in your xresources file !


----------



## nekoexmachina (Mar 26, 2010)

what's your locale?
Also, vi doesn't support utf8, use vim instead.


----------



## miniqq (Mar 27, 2010)

Yes , My system locale set to zh_CN.UTF-8
I don't think you need to modify .login_conf


----------



## alphachi (Apr 27, 2010)

Thanks for all help, I have solved the problem. The main reason is encoding, because the Windows(ver.CN) use GB2312/GBK/GB18030 encoding. After copy these files&dirs, I should use some Ports to convert their encoding from GB* to UTF-8:

Ports:convmv - converts filenames from one encoding to another

Ports:enca -- detect and convert encoding of text files


----------

