<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Cases like these are exactly why we do not include an
implementation in SWORD for uppercasing a string. I would guess
the primary switch in SWORD to provide this, ICU support, does
correctly handle your scenario, so I hope, "yes," is the answer,
but I haven't checked.</p>
<p>It wouldn't be a bad idea to include a unit test for stringmgr,
which we don't currently have.</p>
<p>Troy<br>
</p>
<div class="moz-cite-prefix">On 1/31/21 10:26 AM, David Haslam
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:YKiCnEDybSmRUayipPge3t0MIdEUBh5FJcdgvx5Y3W9Ia_INV1P32XrC-ugQLow6XXtW93SyidczZQLc2qTz4VYKcPPrvjytECaM3-i4oMA=@protonmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div>Hi Troy,</div>
<div><br>
</div>
<div>Does what you describe about case conversion deal correctly
for those few letters where case rules are different in some
locales?</div>
<div><br>
</div>
<div>For example, Turkish and Azerbaijani have both lowercase and
uppercase letters for both dotted iİ and dotless ıI.</div>
<div><br>
</div>
<div>Uppercase(“i”<caret></caret>) in Turkish is NOT “I” but “I”.</div>
<div><br>
</div>
<div>Asking for a friend. :) </div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>David</div>
<div><br>
</div>
<div id="protonmail_mobile_signature_block">
<div>Sent from ProtonMail Mobile</div>
</div>
<div><br>
</div>
<div><br>
</div>
On Sun, Jan 31, 2021 at 17:11, Troy A. Griffitts <<a
href="mailto:scribe@crosswire.org" class=""
moz-do-not-send="true">scribe@crosswire.org</a>> wrote:
<blockquote class="protonmail_quote" type="cite">
<p>Dear Tobias,</p>
<p>My apologies for taking so long to respond to this, but I
wanted to give a thorough answer. See the summary at the end
if you don't care about the details.<br>
</p>
<p>So, SWORD has a class StringMgr, which manages strings within
SWORD, and by default SWORD includes a very basic
implementation, which doesn't necessarily know about or
support anything beyond what the basic C string methods
support.</p>
<p>I am sure this invokes a sense of horror from you at first,
so let me explain a bit how we properly handle character
sets. First, short background: since we existed well before
the Unicode world, we have multiple locale files for each
language, which you will still see in the locales.d/ folder,
each specifying their character encoding, and most of the time
SWORD doesn't need to manipulate characters, so simply holding
data, and passing that data to a display frontend, and
specifying a font which will handle that encoding was enough
in the old world. IMPORTANT: the one place we do need to
manipulate character data is to perform case-insensitive
comparisons. We did this in the past by converting a string
to uppercase before comparison. You'll notice this in the
section for Bible book abbreviation in each locale-- the
partial match key must be in a toupper state.</p>
<p>Today, everything in SWORD prefers Unicode and specifically,
encoded as UTF-8. To support this:</p>
<p>First, we have utility functions within SWORD for working
with Unicode encoded strings, see:</p>
<p><a class="moz-txt-link-freetext"
href="http://crosswire.org/svn/sword/trunk/include/utilstr.h"
moz-do-not-send="true">http://crosswire.org/svn/sword/trunk/include/utilstr.h</a></p>
<p>Specifically:<br>
</p>
<pre>SWBuf assureValidUTF8(const char *buf);
SW_u32 getUniCharFromUTF8(const unsigned char **buf, bool skipValidation = false);
SWBuf *getUTF8FromUniChar(SW_u32 uchar, SWBuf *appendTo);
SWBuf utf8ToWChar(const char *buf);
SWBuf wcharToUTF8(const wchar_t *buf);
</pre>
<p>To wrap this up, by subclassing StringMgr, SWORD supports
implementing character encoding by linking to other libraries,
e.g., ICU, Qt, etc. to handle full Unicode support. And while
the StringMgr interface allow implementation of many string
functions, upperUTF8 is the only real method the SWORD engine
needs to work completely. Some utilities use the other
methods in there, but the engine, only needs this method.<br>
</p>
<p><br>
</p>
<p>In summary, on Android, you are likely not linking to ICU
when you build the native SWORD binary-- which I don't do
either for Bishop. The Cordova SWORD plugin uses the SWORD
java-jni bindings, which use the Java VM to implement
StringMgr:</p>
<p><a class="moz-txt-link-freetext"
href="https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp"
moz-do-not-send="true">https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp</a>
Search for: AndroidStringMgr<br>
</p>
<p>And on iOS the Cordova plugin uses the Swift libraries to do
the same. This is done by using the SWORD flatapi call to
org_crosswire_sword_StringMgr_setToUpper to provide a Swift
implementation to uppercase a string. <br>
</p>
<p><a class="moz-txt-link-freetext"
href="http://crosswire.org/svn/sword/trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift"
moz-do-not-send="true">http://crosswire.org/svn/sword/trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift</a></p>
<p>I hope this give you the information you need to get things
working for you. Please don't hesitate to ask if you need
help,</p>
<p>Troy<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 1/17/21 11:59 AM, Tobias Klein
wrote:<br>
</div>
<blockquote type="cite">Dear Troy, <br>
<br>
I'm playing with an Android Build of Sword and I get issues
with the German Umlauts. <br>
<br>
So I have issues with Bible book names like Römer, Könige,
etc. <br>
<br>
The Umlauts are shown as ?. <br>
<br>
I'm configuring the SWORD build with CMake like below (without
ICU!) <br>
<br>
I remember having similar issues on Linux when building
without ICU. <br>
<br>
How do you build SWORD for Bishop? Any suggestions? <br>
<br>
Best regards, <br>
Tobias <br>
<br>
-- Check for working CXX compiler:
/opt/Android/SDK/ndk/r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++<br>
-- Check for working CXX compiler:
/opt/Android/SDK/ndk/r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
-- works <br>
-- Detecting CXX compiler ABI info <br>
-- Detecting CXX compiler ABI info - done <br>
-- Detecting CXX compile features <br>
-- Detecting CXX compile features - done <br>
-- Check for working C compiler:
/opt/Android/SDK/ndk/r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang<br>
-- Check for working C compiler:
/opt/Android/SDK/ndk/r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
-- works <br>
-- Detecting C compiler ABI info <br>
-- Detecting C compiler ABI info - done <br>
-- Detecting C compile features <br>
-- Detecting C compile features - done <br>
-- Configuring your system to build libsword. <br>
-- SWORD Version 1008900000 <br>
</blockquote>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
</body>
</html>