線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1582
推到 Plurk!
推到 Facebook!

字串轉TXT檔中文字被截斷問題?

答題得分者是:supman
huangeider
高階會員


發表:288
回覆:492
積分:231
註冊:2003-02-26

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-05-09 16:57:43 IP:61.222.xxx.xxx 未訂閱
procedure TForm1.Button1Click(Sender: TObject);
VAR A:TSTRINGLIST;
    B:STRING;
begin
A:=TSTRINGLIST.Create;
B:='文字檔測試';
A.CommaText:=B[1] B[2] B[3] '黃';
A.SaveToFile('C:\2.TXT');
end;
想讓轉出結果為文?黃
但是轉出文字檔後內容為"文朱?"
不知如何取代中文字截斷的斷碼或者判斷當中文字時就把整個中文字用英文字取代
堅持從洗馬桶做起 Eric
supman
尊榮會員


發表:29
回覆:770
積分:924
註冊:2002-04-22

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-05-09 17:11:17 IP:61.70.xxx.xxx 未訂閱
您好: 要判斷是否為中文字可用以下方是判斷 ByteType(字串,字串位置) 傳回值 mbSingleByte The Char is used to represent an entire character in the string. The value of Char can not be included in the LeadBytes set. mbLeadByte The Char is used to represent the first byte of a double-byte character. The value of Char must be included in the LeadBytes set. mbTrailByte The Char is used to represent the second byte in a double-byte character. There are no a priori restrictions on the value of Char. 假如第一個字元是mbLeadByte就是中文字. 發表人 - supman 於 2005/05/09 17:43:41
系統時間:2024-06-02 2:33:17
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!