Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Appending Unicode text?

Started 1 month, 2 weeks ago by Syslock
I'm using this to append Unicode text: Code: FILE *File = _wfopen( filepath, L"at,ccs=UNICODE" ); This works fine when the Unicode file exists. However, sometimes the file might not exist, and the Unicode text gets appended without re-creating the BOM mark at the beginning of the file, which corrupts the file. Is this how it's suppose to work, or it is a bug? I ...
Site: CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions  CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions - site profile
Forum: Visual C++ Programming  Visual C++ Programming - forum profile
Total authors: 3 authors
Total thread posts: 4 posts
Thread activity: no new posts during last week
Domain info for: codeguru.com

Other posts in this thread:

_Superman_ replied 1 month, 2 weeks ago
The BOM is not automatically created. You will have to write the it yourself at the begining of the file.

Syslock replied 1 month, 2 weeks ago
Quote: Originally Posted by _Superman_ The BOM is not automatically created. You will have to write the it yourself at the begining of the file. Thanks for the reply. That's a bummer!

cilu replied 1 month, 2 weeks ago
Before opening, you can check whether the file exists. If it doesn't exist, you create it, write the BOM and close. Then you proceed with the rest of the your code. Or you can create your own function, that does all that, and call it instead of each _wfopen call.

 

Top contributing authors

Name
Posts
Syslock
2
user's latest post:
Appending Unicode text?
Published (2009-11-13 23:50:00)
Quote: Originally Posted by _Superman_ The BOM is not automatically created. You will have to write the it yourself at the begining of the file. Thanks for the reply. That's a bummer!
_Superman_
1
user's latest post:
Appending Unicode text?
Published (2009-11-13 22:01:00)
The BOM is not automatically created. You will have to write the it yourself at the begining of the file.
cilu
1
user's latest post:
Appending Unicode text?
Published (2009-11-15 12:51:00)
Before opening, you can check whether the file exists. If it doesn't exist, you create it, write the BOM and close. Then you proceed with the rest of the your code. Or you can create your own function, that does all that, and call it instead of each _wfopen call.

Related threads on "CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions":

Related threads on other sites:

Thread profile page for "Appending Unicode text?" on http://www.codeguru.com. This report page is a snippet summary view from a single thread "Appending Unicode text?", located on the Message Board at http://www.codeguru.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity