Mistake of opening of a file having a name in cp1251.

2015-04-03 Thread MGW via Digitalmars-d-learn
Greetings to all! I work on Windows with cp1251 and I have a mistake in the program: import std.stdio; int main (string [] args) { string nameFile = `«Ёлки с объектами №876».txt`; File f = File (nameFile, w); f.writeln (Greetings!); return 0; } This mistake of a kind:

Re: Mistake of opening of a file having a name in cp1251.

2015-04-03 Thread Danny via Digitalmars-d-learn
According to the documentation https://msdn.microsoft.com/de-de/library/yeby3zcb.aspx, _wfopen already takes a wide-character string, not an ANSI string. So return _wfopen(name.tempCStringW(), mode.tempCStringW()); would be the correct way. All these weird ansi versions are Windows

Re: Mistake of opening of a file having a name in cp1251.

2015-04-03 Thread MGW via Digitalmars-d-learn
The decision, which I have applied using function fromUtf8toAnsiW() already works correctly. I use dmd 2.067.0

Re: Mistake of opening of a file having a name in cp1251.

2015-04-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/3/15 2:26 AM, MGW wrote: Greetings to all! I work on Windows with cp1251 and I have a mistake in the program: import std.stdio; int main (string [] args) { string nameFile = `«Ёлки с объектами №876».txt`; File f = File (nameFile, w); f.writeln (Greetings!); return 0; }