<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<red faced/> Font.<br>
<br>
<div class="moz-cite-prefix">On 10/7/2014 1:56 PM, Jon Behrens
wrote:<br>
</div>
<blockquote cite="mid:54344565.2060004@crimsonthread.com"
type="cite">Hello again,
<br>
<br>
There are some breaking differences between the Windows version of
'libsword'
<br>
and the Linux version. When executing the same C# code I get
different results
<br>
depending on which OS I am running. Here is the code I'm running
(the two OSs
<br>
use the same file with symbolic links, so they are identical.)
<br>
<br>
public static void testBench(string modName, string outfile) {
<br>
StreamWriter sw = new StreamWriter(outfile, false,
Encoding.Unicode);
<br>
using (var manager = new Manager(Enviro.swordHome)) {
<br>
var module = manager.GetModuleByName(modName);
<br>
if (module == null) {
<br>
sw.WriteLine("******Error*******");
<br>
sw.WriteLine("Could not find {0}.", modName);
<br>
}
<br>
module.KeyText = "gen.1.3";
<br>
while (!module.PopError()) {
<br>
sw.WriteLine(module.KeyText);
<br>
sw.WriteLine(module.RenderText());
<br>
sw.WriteLine("RawEntry length = " + module.RawEntry.Length);
<br>
sw.WriteLine("EntrySize = " + module.EntrySize);
<br>
module.Prevous();
<br>
}
<br>
}
<br>
sw.Close();
<br>
}
<br>
<br>
*********Linux Version ************
<br>
Genesis 1:3
<br>
And God said, “Let there be light,” and there was light.
<br>
RawEntry length = 358
<br>
EntrySize = 362
<br>
<br>
Genesis 1:2
<br>
The earth was without form and void, and darkness was over the
face of the deep. And the Spirit of God was hovering over the face
of the waters. <br />
<br>
<br />
<br>
RawEntry length = 348
<br>
EntrySize = 348
<br>
<br>
Genesis 1:1
<br>
In the beginning, God created the heavens and the earth.
<br>
RawEntry length = 879
<br>
EntrySize = 879
<br>
<br>
************Windows Version*****************
<br>
Genesis 1:3
<br>
And God said, “Let there be light,” and there was light.
<br>
RawEntry length = 362
<br>
EntrySize = 7513747286636101994
<br>
<br>
Genesis 1:2
<br>
The earth was without form and void, and darkness was over the
face of the deep. And the Spirit of God was hovering over the face
of the waters. <br />
<br>
<br />
<br>
RawEntry length = 348
<br>
EntrySize = 7513747286636101980
<br>
<br>
Genesis 1:1
<br>
In the beginning, God created the heavens and the earth.
<br>
RawEntry length = 879
<br>
EntrySize = 7513747286636102511
<br>
**********************************************
<br>
<br>
Notice in the Linux version the quotes in Gen.1.3 around "Let
there be light," render
<br>
properly and those in Windows do not.
<br>
<br>
The underlying function in flatapi.cpp is:
<br>
const char SWDLLEXPORT * org_crosswire_sword_SWModule_renderText
(SWHANDLE hSWModule)
<br>
<br>
Notice that the two entry lengths give different numbers in Linux
than Windows. (In neither
<br>
case do the numbers appear to mean anything with Windows having
the advantage of not even
<br>
looking reasonable.)
<br>
<br>
At first blush, it looks as if there is a compiler option not
properly set in Windows so that unicode
<br>
module text is being processed as ASCII which is then being passed
to C#.
<br>
<br>
Thanks for any help - and blessings,
<br>
Jon
<br>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<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://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
<br>
</body>
</html>