日文文件名以垃圾字符存储

时间:2015-02-19 14:48:21

标签: java linux utf-8 debian

我的名字中有一个日文字符文件,我使用以下代码从Windows上传到Debian(Linux):

file.write( new File( "/storing/path/", "ネットワーキング.xml" ) );

当我在Debian(Linux)中通过命令提示符检查文件时,它存储为

"???????????.xml"

我尝试了不同的方法,但直到现在都没有用 -

1)使用BufferedReader

 BufferedReader reader = new BufferedReader(
        new InputStreamReader( file.getStream() , "UTF-8") );

BufferedWriter writer = new BufferedWriter(
        new OutputStreamWriter(
                new FileOutputStream(
                        new File( "/storing/path/", "ネットワーキング.xml" )), "UTF-8"));

2)点击此链接http://okomestudio.net/biboroku/?p=1834  尝试在Debian中添加语言环境:

a) $ sudo aptitude install locales im-config
b) $ sudo dpkg-reconfigure locales -> added en_US.UTF-8 and ja_JP.UTF-8
c) Set the default locale for the system to en_US.UTF-8. 
d) Install some Japanese fonts:
e) $ sudo aptitude install ttf-kochi-mincho ttf-kochi-gothic ttf-sazanami-mincho

然后尝试只使用ja_JP.UTF-8语言环境

我做错了什么,在哪里?

提前致谢。

0 个答案:

没有答案
相关问题