Andre Poenitz wrote:
On Wed, Jan 16, 2008 at 02:26:40PM +0100, [EMAIL PROTECTED] wrote:
Quoting Andre Poenitz <[EMAIL PROTECTED]>:
On Tue, Jan 15, 2008 at 12:11:14AM +0100, Abdelrazak Younes wrote:
Jean-Marc Lasgouttes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Actually, even on Unix I expect things to be faster if we use QString
instead of iconv. Just look at the mess that this library forces on us
(IconvProcessor and co). I'd be very much in favor of doing that, if
only for the code reduction (basically all of unicode.{cpp,h} and a
good part of docstring would go). Also because we use QString already
for ucs4 to/from utf16 conversion and ucs4 to/from 8bits encoding.
You mean forcing QString everywhere?
No, I mean the attached.
[...]
This is, unfortunately, ~30% slower than the iconv based version.
However, the code as such is only about 100 lines, and "manual
incorporating" it would bring it down to maybe 60 lines and probably on
par runtime-wise.
I am not sure I understand "manual incorporating"... you mean removing the
data coying overhead?
Basically the utf8 -> utf16 -> ucs4 version does two conversion that
could be collapsed into a single one. The code itself is fairly simple,
so most time spend is indeed 'touching' data.
See http://www.unicode.org/Public/PROGRAMS/CVTUTF/ for Unicode
conversion functions by the Unicode Consortium (including UTF-8 to UTF-32).
Joost