Hi,

Am Donnerstag, 13. September 2007 08:46 schrieb Michael Riepe:
> Since we also use "<<" with a "const char*" argument, which has the same
> properties, the cleanest solution is to do it this way:
>
>       stream.setEncoding(QTextStream::Latin1);
>       stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
>       stream << doc.toCString();
>
> If we ever replace the QTextStream with a std::ostream or another "byte
> transparent" kind of stream, this variant will continue to work, while
> the other one won't.
>
> On my system, this creates a correctly encoded project file in both
> Latin-15 and UTF-8 based locales. I'll check the Windows part this evening.
>
Yepp,... this version also works on my OpenSuse-Linux... as expected...
and I expect it also to work under Windows! ;-) 

The important thing is obviously to specify the stream encoding explicitely 
(no matter which type), since under Windows and Linux different default 
encodings are used otherwise... probably the locale set by $LANG, which is 
not there under Windows and therefore using none at all... 
This could also explain your observation with (implicite) Latin-15 and 
toCSring... 

ciao
Ralph

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
DVBCUT-user mailing list
DVBCUT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to