LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: xlinlover

我想装debian:支持日文,能够支持日文windows的默认文本编码(JIS)。但希望manpage和界面

[复制链接]
 楼主| 发表于 2005-11-12 10:15:03 | 显示全部楼层
iconv 很好用。我自己写了一个角本来自动将eucJP-WIN的编码改为UTF8的编码。
现在有一点不好,就是虽然编码转换好了,但日文显示还是有问题。有很多字符无法正常显示。scim的日文输入法法也是一样的问题。包括debian linux下的所有可以显示日文的编辑器也是。我想应该是没有更好的字体的原因。但是不知道怎么解决。

把我编码转换用的角本放在这里,给有用的兄弟。
______________________________________
#! /bin/sh
##file transDir.sh
##author:xlinlover(www.linuxsir.cn)
##Usage: transDir.sh [DIRname|FILEname]
##Function:
##Traverse the directory
##&& Convert the .txt .h .c file from eucJP-WIN encoding to UTF-8 encoding
##Note:Your text should be eucJP-WIN encoding
##&& Your system should have iconv installed
if [ "$#" -ne 1 ] ; then
echo "Usage: $0  DIRname "
exit
fi

reEnter(){
local i L
[ "${1:0:1}" = "/" ] && L="$1" || L="$PWD/$1"

echo "Current directory $L"

if [ -d "${L}" ] ; then
cd "${L}"  ## Must use "" to prevent blank
echo "Enter in $L"


local fn="$(ls | tr '\n' "
old_IFS="$IFS"
IFS=:
for i in $fn ; do
if [ -f "$i" ]; then ##If is a file,do some work
if [ "`echo $i|egrep '\.c'`" -o "`echo $i|egrep '\.h'`" -o "`echo $i|egrep '\.txt'`" ]; then
cp "$i" "$i~"
iconv -f EUCJP-MS -t UTF8  "$i~" -o "$i~~"
cp "$i~~" "$i"
rm -f "$i~"
rm -f "$i~~"
echo " $i "
fi

fi


if [ -d "$i" ]; then ##If is a directory ,enter the directory recursively
reEnter "$i"
fi

done
cd ..
fi
return
}
reEnter "$1"
IFS=old_IFS ;

______________________________________
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表