Hi!

> From: Michael Riepe <[EMAIL PROTECTED]>
> 
> Wolfram Gloger wrote:
> 
> >>The real cause is not the filename itself it is the conversion from QString 
> >>to 
> >>std::string and back, because the internal format of QString is unicode 
> >>whereas std::string is using ascii.
> > 
> > That is not true.  I can put anything I want in std::string, it
> > doesn't care whether it is UTF8 or ascii or latin1 or whatever, as
> > long as it consists of 8 bit "characters".
> 
> It can do so because it doesn't (have to) interpret the data.
> 
> Qt, however, has to map the raw bytes to font glyphs. The result of that
> translation - i.e. whether 0x41 is displayed as "A", and so on - always
> depends on the chosen character set encoding.

That is true when glyphs need to be generated (such as for the file
selector and lots of other functions, no dispute there).  But I
was told more than 10 years ago that Qt is supposed to be a general
class library, so I'm greatly surprised to find this in "QString".
If it was called "QGlyphs" or similar that conversion could be
made more explicit.

> On the other hand, the world is a jungle where every animal might use a
> different encoding. Even if you use UTF-8 throughout a system, there are
> other systems on the net that don't. I've been bitten by that myself
> several times when I used an entirely UTF-8 based Linux desktop at work.
> Login to a Latin-1 based system via ssh, and then type some umlauts to
> see what I mean.

Oh yes, very very true.  Just encountered that again yesterday.

> I finally gave up and instructed the keyboard driver to
> not generate Unicode characters any more.

Wow, I would not have considered that possibility :-)
[Off topic, but how did you do that?
 For me, using "xterm" (not "uxterm") _and_ unsetting LANG "works"
 in this situation.]

> In general, the character encoding problem is unsolvable -

Ack.

> As far as I can
> tell, there are only two ways to cope with it:
> 
> - treat filenames as opaque objects (i.e. strings of raw bytes)
> - use the same encoding for all filenames
> 
> The former won't work because Qt requires UTF-8 encoding.

I'm strongly on favour of the first option whereever possible.
Has someone tried

QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());

yet?

Regards,
Wolfram.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
DVBCUT-user mailing list
DVBCUT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to