Hi!

Wolfram Gloger wrote:
[...]
>>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".

STL is a general class library. Qt is a GUI toolkit that shouldn't do
its own string handling at all. Or, do it transparently.

> If it was called "QGlyphs" or similar that conversion could be
> made more explicit.

In most GUI toolkits, a "string" is an object that holds text (that, in
turn, is supposed to be displayed on the screen). And it usually causes
problems when it comes to character sets - not only with Qt.

[...]
>>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.]

It was a little more difficult at that time. I was using a rather old
(7.x?) Suse Linux and I had to reconfigure several subsystems. Nowadays
you just have to specify that you don't want Unicode, as far as I
remember. I haven't dealt with that issue for quite a while.

[...]
>>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.

That won't work because there are sequences of bytes that are not valid
UTF-8 strings. Latin-1 filenames with umlauts in them, for example. You
have to convert them, *and* you have to convert them back to Latin-1
when you want to access the file by ordinary (Unix/Linux) means, i.e.
open(). Therefore, you also have to remember a) that you converted them
at all, and b) how you did it. But what's worst is that you have to
detect whether a filename is UTF-8 or Latin-1 encoded. Which is
something a piece of software simply can't do.

> Has someone tried
> 
> QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
> 
> yet?

Not yet (I'm at work).

-- 
Michael "Tired" Riepe <[EMAIL PROTECTED]>
X-Tired: Each morning I get up I die a little

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to