Right, I tried it using TypeText, and the result was that stuff contained ÿÞH (if that doesn't come out, it's y-umlaut, thorn, capital H) ie the BOM in ASCII + a capital H. To me this looks very much like the program thinks the file is in ANSI format, whereas at least when I used TypeBinary it...
I'm 90% sure I tried this and it did something weird, however I will try it again on Friday when I am next at work.
Could you explain to me the purpose of TypeBinary and TypeText, because I couldn't make it out from MSDN. Why would TypeBinary let ascii characters work but not others?
Thanks...
Hi there,
I'm trying to read from a unicode file. The contents of the file is the word "hello" followed by a tab and then a schwa (unicode character that looks like an upside-down e)
It is saved in unicode, and it has the BOM 0xFF 0xFE at the start.
Now I do the following in my...
Hi there,
I just found the CStdioFile class which I'd overlooked before and it seems to be dealing with unicode nicely.
Thank you very much both of you for your help.
Yes, the program is still reading in the string in the file as the ASCII representation of the two bytes indicating that the file is in unicode + "H".
Just to clarify, I am not having trouble getting the program to store and manipulate two-byte chars. I am only having trouble reading...
IonFilipski, I thought the whole purpose of _T was to choose char or wchar_t depending on whether UNICODE was defined. I was under the impression that it was equvalent to L.
JohnLac, I am using TCHAR, _ftprintf, _tcscopy etc. Eg, here is the code I have been testing with:
//Reading from file...
Hi there.
I am trying to convert my program from reading from and writing to files with ANSI encoding to reading from and writing to files with unicode encoding. I am using notepad to read/write the files. I have been looking at my new files in a hex editor and they are being saved in unicode...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.