Re: [問題] 從txt匯入中文?
※ 引述《biiiii (阿關)》之銘言:
: 請問有沒有高手知道如何從txt檔匯入中文?
: win7 區域語言設定 台灣
: matlab 7.7.0(R2008b)
: matlab font preference設定 微軟正黑體
: eiditor中可顯示中文comment
: 但txt檔裡的中文 讀進來是亂碼
: 如果在command window直接輸入中文 得到:
: a=
把temp.txt以unicode編碼儲存 該檔案內容為"我" 用以下指令 依然顯示亂碼
>>fid=fopen('temp.txt')
>> a=fread(fid)
255
254
17
98
>> char(a)
ans=
y
p
b
或者
>>a=fread(fid,'unit16')
a=[]
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 132.166.141.80
※ 編輯: biiiii 來自: 132.166.141.80 (03/15 20:32)
討論串 (同標題文章)