Writing Unicode Strings using wxFile
Amit
amitgupta.it at gmail.com
Tue Nov 28 23:39:08 PST 2006
Amit wrote:
> > A> So when I use wxFile to write all the content, unicode part is not
> > A> written correctly.
> >
> > This is really unhelpful. If you want other people to help you, please do
> > make at least some effort to explain your problem. E.g. show what exactly
> > do you write and what you get in the file.
> >
> > A> i.e. When I try to import the csv file in excel the unicode value's
> > A> appear as junk values .
> >
> > Maybe Excel simply doesn't like UTF-8.
>
> Some detailed info
>
> As I told you earlier I am trying to export values in a Multi Column
> List Control to a CSV file.
>
> For this I parse all the column and append the values to a wxString
> object & then I write this object to a text file using wxFile.
> I am using the following code to achieve this.
>
> wxString strSearchResults ; //this object has the values of a
> list ctrl in csv format
> wxFile tempFile;
> if(tempFile.Open(wxT("SearchResults.txt"), wxFile::write))
> {
> tempFile.Write(strSearchResults);
> tempFile.Close();
> }
>
> All ascii characters are written correctly except for unicode values.
> For e.g "åååååååå" is written as
> "åååååååå".
>
> I hope the information is sufficent for understanding my troubles.
>
> Regards
> - Amit Gupta
One more interesting piece of information
When the resultant file is viewed in TextPad (win XP) Unicode
characters appear as they should but in excel they appear as junk
values.
Regards
- Amit Gupta
More information about the wx-users
mailing list