[Qt-interest] How to compress QString

Iurii Gordiienko hordi at ukr.net
Thu Apr 16 14:39:20 CEST 2009


OK. Thanks. I was mistaked about UTF-8...    
    
--- Original Message ---    
From: <Oliver.Knoll at comit.ch>    
To: <qt-interest at trolltech.com>    
Date: 16 april, 15:27:36    
Subject: Re: [Qt-interest] How to compress QString    
    
    Iurii Gordiienko wrote on Thursday, April 16, 2009 1:48 PM:    
    
> We can't convert UNICODE string to UTF-8 because data will be loss.    
    
I don't quite understand: which data will be lost? UTF-8 is a perfect representation of ANY unicode character!    
    
Roughly said for ASCII characters UTF-8 uses just 1 byte, for all other characters it uses more than what UTF-16 representation would use (e.g. 3 or 4, instead of just 2 bytes per character) ("multibyte sequence").    
    
I am not an Unicode expert, so some details above might be plain wrong; but you can convert from UTF-16 to UTF-8 back and forth, without data loss!    
    
Also refer to http://doc.trolltech.com/4.5/qstring.html#details: "toUtf8() returns a UTF-8 encoded 8-bit string. UTF-8 is a superset of ASCII that supports the entire Unicode character set through multibyte sequences."    
    
Cheers, Oliver    
--    
Oliver Knoll    
Dipl. Informatik-Ing. ETH    
COMIT AG - ++41 79 520 95 22    
_______________________________________________    
Qt-interest mailing list    
Qt-interest at trolltech.com    
http://lists.trolltech.com/mailman/listinfo/qt-interest    
    
    
    
    
--    
    Рецепт успеха в Сети. Новый номер журнала InternetUA.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090416/ab124cae/attachment.html 


More information about the Qt-interest-old mailing list