Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
关于samba的问题
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
net_colt
n00b
n00b


Joined: 14 Aug 2006
Posts: 1

PostPosted: Mon Aug 14, 2006 1:57 pm    Post subject: 关于samba的问题 Reply with quote

如何用samba共享中文目录和文件名中有中文的文件,我在windows中看我共享的中文名文件和中文目录都是乱码 :?
Back to top
View user's profile Send private message
akar
Moderator
Moderator


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Thu Aug 17, 2006 10:21 am    Post subject: Reply with quote

  一 首先搞清楚在服務器下中文是什麼編碼,可以用以下方法:

Code:

$ cd 'samba 的共享目錄'
$ ls > filelist_test.txt

  在客戶端查看 filelist_test.txt 的內容中的中文是何編碼。 (如果看不見filelist_test.txt,那是權限問題,自己想辦法)


  二 檢查 samba 的版本,第二版時是可以用 client code page 來設置成支持本地編碼,比如(cp936簡體, cp950繁體), 第三版有了很大的改變,不再支持 client code page,只可以用utf-8統一編碼。


  三 用工具轉服務器上的中文文件的文件名稱的編碼。

- 下載並安裝文件名稱的轉換程式
Code:

$ wget http://j3e.de/linux/convmv/convmv-1.10.tar.gz
$ tar zxf convmv-1.10.tar.gz
$ cd  convmv-1.10
# make install


- 使用 convmv 來轉換文件名稱的編碼
  第一道指令是空執行,並不真正修改系統內的文件名字,第二道是真實執行,它會把文件從原本的編碼轉到utf8的編碼,例子中用的是 big5-hkscs ,但如果是簡體的,很可能是 cp936 。可以用指令 convmv --list 得到所有被支持的可轉換文字編碼。
Code:

# convmv -f big5-hkscs -t utf8               -r  'samba 的共享目錄'
# convmv -f big5-hkscs -t utf8 --notest -r  'samba 的共享目錄'

_________________
AKar
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum