<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Is ICU4C out of the question? It has support for collation. See: <a href="http://site.icu-project.org/design/collation/v2" class="">http://site.icu-project.org/design/collation/v2</a><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 12, 2016, at 11:12 AM, Karl Kleinpaste <<a href="mailto:karl@kleinpaste.org" class="">karl@kleinpaste.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="content-type" content="text/html; charset=utf-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
<font face="FreeSerif" class="">To produce Xiphos' module trees (sidebar,
mod.mgr, adv.search), I sort by language using qsort+strcmp. This
was recently pointed out as being poor for UTF-8 strings, and I
replaced strcmp with strcoll. This works fine in Linux.
Unfortunately, the Win32 version of strcoll believes in UTF-16,
even when the locale is set to xx_YY.UTF-8, and this mis-sorts
everything, e.g. Čeština lands in the middle of the "A" region.
Are there any suggestions for a suitable comparator I can use with
qsort, that won't make me do a huge amount of transcoding everything
to UTF-16 when the strings and the app are otherwise entirely
driven in UTF-8?<br class="">
</font>
</div>
_______________________________________________<br class="">sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="">sword-devel@crosswire.org</a><br class=""><a href="http://www.crosswire.org/mailman/listinfo/sword-devel" class="">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br class="">Instructions to unsubscribe/change your settings at above page</div></blockquote></div><br class=""></div></body></html>