digitalmars.D.learn - UTF8 Encoding: Again
digitalmars.D.learn-UTF8符号化:再び
Tue, 9 Aug 2005 19:49:17 +0000 (UTC)
jicman <jicman_member xx pathlink.com>
writes:
2005年8月9日(火)の19:49:17+0000(UTC)jicman<jicman_member xx pathlink.com>は以下の宛て先に書きます:
Greetings!
挨拶!
Sorry about this, but I have found a wall with UTF8, again. Perhaps, some of
すみませんが(これに関して)、私は、再びUTF8を備えた壁を見つけました。恐らく、いくらか、の
you may be able to help me jump it or break through it.
私がそれによってそれまたは破損をジャンプするのを助けることができるかもしれません。
I have this code,
私はこのコードを持っています、
char[] GetMonthDigit(char[] mon)
炭 GetMonthDigit([]) (炭[]mon)
{
{
char [][char[]] sMon;
炭[][炭[]sMon];
sMon["a??t"] = "08";
sMon「a]」 t=「08」;
return sMon[mon];
sMon[mon]を返します;
}
}
if I call this from within the program
私がプログラムの内部からこれを呼ぶ場合
char[] mon = GetMonthDigit("a??t");
炭 mon=GetMonthDigit([])(「a t」);
mon will have "08", however if it comes from another text file, say an ASCII
それが別のテキストファイルから来る場合しかしながら、monは「08」を持つだろう、とASCIIが言います。
file, it fails. So, if you take a look at this small piece of code,
ファイル、それは失敗します。そのように、コードのこの小さな部品を見る場合、
import std.stream;
輸入規格流れ;
void main()
無効のメイン()
{
{
char[] fn = "test.log";
炭 fn=([])「test.log」;
char[] txt = "ao??t";
炭 []txt=「ao; t」
File log = new File(fn,FileMode.Append);
ファイル丸木=新しいファイル;(fn、FileMode.Append)
log.writeLine(txt);
log.writeLine(txt);
log.close();
log.close ();
}
}
this will create a file, if it does not exists, called test.log after compile
それがしない場合、これはファイルを作成するでしょう、後にtest.logと呼ばれて、存在する、コンパイルする。
and run, and it will write, supposely, the content of txt. However, when you
そして、走ってください。そうすれば、それは、supposelyに、txtの内容を書くでしょう。しかしながら、いつ、あなた
open the test.log file, the content of it is,
test.logファイルを開く、その内容はそうです、
ao??t
ao t
Hmmmm... I tried setting the editor settings to UTF8, and others, however,
Hmmmm...Iは、UTF8にエディター・セッティングをセットしてみました、また他のもの、しかしながら、
nothing has worked. Any ideas how I can fix this?
何も作動していません。私がどのようにこれを固定することができるかという任意の考え?
thanks,
ありがとう、
jos?Ebr>
jos?Ebr>