Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2007

Tip: Looking for answers? Try searching our database.

Odd behavior of fopen with ccs option

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PLS - 24 May 2007 01:31 GMT
I'm puzzled about the behaviour of fopen with the ccs= options. The
table below iswhat I'm seeing. I am opening a file with the fopen option
shown, then writing to it with fputws. What I want to happen it to read
either Ascii or Unicode files as Unicode, but to write the files as
Unicode when it is a new or compiletely overwritted file. Reading works
fine, writing does not.

Existing     fopen                    Resulting
File         option                   File
---------------------------------------------------
No file      w+tS, ccs=UNICODE        Ascii
No file      wtS, ccs=UNICODE         UTF-16LE
Ascii        w+tS, ccs=UNICODE        Ascii
Ascii        wtS, ccs=UNICODE         UTF-16LE
Unicode      w+tS, ccs=UNICODE        Ascii
Unicode      wtS, ccs=UNICODE         UTF-16LE

I do not understand why "w+" would be different from "w". Why does it
work this way?

 Thanks,
   ++PLS
Norman Diamond - 24 May 2007 03:13 GMT
It looks to me like several programmers were involved in coding the fopen
and fwrite routines.  It looks to me like different programmers read
different parts of the MSDN page that specifies fopen.

> I'm puzzled about the behaviour of fopen with the ccs= options. The
> table below iswhat I'm seeing. I am opening a file with the fopen option
[quoted text clipped - 18 lines]
>  Thanks,
>    ++PLS

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.