ISO-8859-1 file in ANSI build

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Tim
Earned some good credits
Earned some good credits
Posts: 104
Joined: Wed Nov 23, 2005 5:41 pm

ISO-8859-1 file in ANSI build

Post by Tim » Fri May 12, 2006 5:03 pm

Hi,
I have posted this topic few week ago, but I'm not sure anymore.

With an ANSI compiled version of my EXE (winXP wx 2.6.2) can I read a file where are present char like these ?

eco
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 203
Joined: Tue Aug 31, 2004 7:06 pm
Location: Behind a can of Mountain Dew
Contact:

Post by eco » Fri May 12, 2006 5:27 pm

Although you are extremely lacking in details, I bet you're looking for something like this:

Code: Select all

wxFile file("somefile.txt");
char buffer[1025];
file.Read(buffer, 1024);
buffer[1024] = '\0';
wxString some_iso8859_1_string(buffer, wxConvISO8859_1);
Also, I'm sure there is a much cleaner way (wxStringBuffer perhaps).

Post Reply