<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The only target system that does not support such a conversion on its own would be<div>Xorg/Trestle. You would need to convert to utf-16 and then byte swap for little endian</div><div>machines as the XChar2b is defined as a struct with the hi byte first.</div><div><br></div><div><br><div><div>Am 02.06.2014 um 08:29 schrieb Elmar Stellnberger:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div><br><br>But do gtk and qt actually treat all characters as 16-bit fixed-size code points, or do they<br>actually use UTF16, with the 16-bit value being a code unit, not a code point? In the<br>latter case, using UniWr and UniRd to do the encoding/decoding would be a much cleaner<br>option.<br><font class="Apple-style-span" color="#3a741c"><br></font></div></blockquote><br></div><div>Qt and Gtk should be able to handle true UTF-16 including surrogate pairs so that</div><div>finally making an UniRd and UniWr from such a 16bit type would be the way to go.</div><div>As far as I have researched Gtk has some UCS-4 conversion functions by its own. </div><div>Qt has a QString::fromUcs4( const unit* unicode, int size=-1) function as well, so </div><div>that we could even do the conversion in some client library. There is also a </div><div>QVector<unit> QString::toUcs4() const which you can apply a .data() upon to get</div><div>an in memory array of UCS-4 characters.</div><div><br></div><div>Elmar Stellnberger</div><br></div></blockquote></div><br></div></body></html>