[LC++] Unicode writing problem

Radhika M G radhika.ganganna at oracle.com
Tue Jan 6 21:57:57 EST 2009


 

Hi,

 

I'm trying to create a csv file in Unicode format. I'm using wofstream to
create the file. 

I'm writing a series of strings and double values to the stream. 

I find that the values written to wofstream stop after writing 9 sets of
data. There are about 37 sets of data. 

 

What could be the issue? 

 

The code that writes data to wofstream is as below: 

 

for ( int i=0; i<str.length(); i++ )

 {

    wchar_t wc = ( str[i]<<16 );

    os << wc;

//     os.seekp( -1, ios_base::cur );

}

 

Where 

str:  wstring. 

os: wofstream 

gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)

 

The above code is called 30-40 times for different values of str. 

 

If I uncomment os.seekp() statement,  the file has no value. 

os.fail() is not showing any error. Unable to figure where things are
failing. 

I'm able to output contents of str on standard ouput. But not able to write
to file completely. 

 

Regards,

Radhika

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20090106/099120b5/attachment.htm 


More information about the tuxCPProgramming mailing list