[Issue 8643] [snn] _wfopen and other non-standard wide-character functions fail with non-ASCII symbols
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 11 13:27:06 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8643
--- Comment #1 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-09-12 00:27:31 MSD ---
These functions treats every UTF-16 codepoint as CP_ACP byte followed by zero
byte (if second byte is non-zero, "Invalid argument" is returned). E.g. this
will work:
---
import std.file: write;
import std.windows.charset: toMBSz;
import core.stdc.stdio: perror;
import std.exception: enforce;
extern (C) nothrow int _wrename(in wchar* from, in wchar* to);
void main()
{
write("1.txt", "123");
wchar[7] arr = "2#.txt\0"w;
arr[1] = toMBSz("Ю")[0];
enforce(_wrename("1.txt"w.ptr, arr.ptr) == 0);
}
---
(still don't understand "File exists" output of original example in
description)
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list