如何更改以及確認 file encoding - Linux

Belly avatar
By Belly
at 2008-11-27T12:56

Table of Contents

請問要如何更改及確認 file encoding?

====================

我是用 iconv 去改,寫成這樣的 shell sciript
把目前目錄底下的所有檔案改成 UTF-8
#!/bin/bash

for i in $(ls)
do
iconv -t UTF-8 $i > temp
mv temp $i
done

===================

但下 ls| xargs file 查看檔案屬性時
卻發現還是有很多 ASCII 編碼的
或是寫成 tex file, english text 之類的 看不出編碼:
abstractCH.tex: UTF-8 Unicode text
abstractEN.tex: ASCII English text
algorithmicx.sty: ASCII English text
algorithm.sty: ASCII English text
algpseudocode.sty: ASCII English text
application.tex: LaTeX document text
conclusion.tex: LaTeX document text
convert_to_utf.sh: Bourne-Again shell script text executable
defs.tex: ASCII text
errors.txt: ASCII text
introduction.tex: LaTeX document text
Makefile: ASCII make commands text
modeling.tex: LaTeX document text
ntu.sty: UTF-8 Unicode English text
ntuvars.tex: UTF-8 Unicode text
photoshoot.tex: LaTeX document text
related.tex: LaTeX document text
thesis.aux: LaTeX auxiliary file
thesis.bib: BibTeX text file
thesis.log: ASCII C++ program text
thesis.out: empty
thesis.pdf: empty
thesis.tex: LaTeX 2e document text

=================================

不知道是 iconv 的問題還是 file 的問題
除了 file,有沒別的方法可以確認編碼?


--
Team Programming Dragon
http://graphics.csie.ntu.edu.tw/~jonathan/tpd/

--
Tags: Linux

All Comments

Xubuntu安裝後.

Edwina avatar
By Edwina
at 2008-11-27T12:48
先謝謝之前的版友提供資訊 我裝了Xubuntu,安裝後重新開機,它會出現要進win還是xubuntu 我選xubuntu 之後 他就停在一個畫面全黑 然後類似一個游標一直在閃的畫面,請問這是什麼情況 我看碟諜也沒有在動作的樣子,這樣是正常還是出了什麼問題 我等了約半個小時還是這樣,能幫我解答一下嗎, ...

Re: Linux套件及軟體安裝問與答

Ula avatar
By Ula
at 2008-11-27T12:47
※ 引述《speedmetal (ASH)》之銘言: : 感激感激....又多學了好多... : 趕快去試試看... : 想再請教個問題..^^ : 記得當初再安裝UBUNTU 8.04.1的時候 我是按照UBUNTU正體中文網的教學 : 只分割 / 以及HOME 目錄兩個磁區 : 但是發現除了這兩個之外還有 ...

Re: Linux套件及軟體安裝問與答

Rae avatar
By Rae
at 2008-11-27T12:23
※ 引述《MilchFlasche (實踐才能發光)》之銘言: : ※ [本文轉錄自 MilchFlasche 信箱] : 作者: MilchFlasche (實踐才能發光) : 標題: Re: [問題]amsn與emesene無法順利執行 : 時間: Thu Nov 27 07:17:48 2008 : ※ ...

Ubuntu 8.10:A user要新增資料在B user的資料夾

Franklin avatar
By Franklin
at 2008-11-27T11:20
如題 請問一下這件事要怎麼做atat? 以前還可以把在瀏覽資料夾的那軟體升成ROOT權限來丟東西 但現在檔案瀏覽器不能升權限了~ 那麼請問一下要怎麼丟東西atat? - ...

嘸蝦米終於正式的支援 Solaris 以及 gcin 和 s …

Joseph avatar
By Joseph
at 2008-11-27T08:15
※ [本文轉錄自 Liu 看板] 作者: solaris10 (柚帥柚美可憐可愛) 看板: Liu 標題: 嘸蝦米終於正式的支援 Solaris 以及 gcin 和 scim 了! 時間: Wed Nov 26 22:04:21 2008 (原文 po 在查碼程式的部落格 http://liuzmd1. ...