- 707 名前:デフォルトの名無しさん mailto:sage [2008/07/13(日) 00:37:29 ]
- >>705
wstring toUTF16(in mbchar[] s, in uint codePage=0) { mbstring sz = (s ~ cast(mbchar)'\0').idup; wstring result; result.length = MultiByteToWideChar(codePage, 0, cast(char*)(sz), sz.length, null, 0); MultiByteToWideChar(codePage, 0, cast(char*)sz, sz.length, cast(wchar*)result, result.length); return result; } invariantであるresultに書き込もうとしてるのはおかしいな。 キャストしてしまってるから本来検出されるはずなのエラーがでなくなってる。 MultiByteToWideChar(codePage, 0, sz.ptr, sz.length, result.ptr, result.length); でコンパイル通るように直したほうがいい。
|

|