[sword-devel] python3 , StrongsGreek and unicodeDecodeError

pierre amadio amadio.pierre at gmail.com
Mon Jun 17 01:45:17 EDT 2019


Hello !

Ohh, i was not aware of the Xiphos "RealGreek" and "RealHebrew" modules.
I do not have a problem with my test case with the greek one.

Looks like i will use those module from now on.

Thanks !

On Sun, 16 Jun 2019 at 21:27, David Haslam <dfhdfh at protonmail.com> wrote:
>
> Does this issue also affect dictionary module StrongsRealGreek in the Xiphos repo?
>
> Or was that encoded correctly as UTF-8 ?
>
> David
>
> Sent from ProtonMail Mobile
>
>
> On Sun, Jun 16, 2019 at 20:14, Troy A. Griffitts <scribe at crosswire.org> wrote:
>
> Hi Pierre,
>
> I had similar problems with our Java bindings.  Java was unforgiving
> with invalid UTF-8 characters, as well.  Ultimately we should fix any
> invalid UTF-8 characters in our modules and encode them correctly, but
> my solution was, in the bindings code, to call:
>
> assureValidUTF8()
>
> before returning results to Java.  This call is available from SWORD's
> utilstr.h
>
> Hope this helps a bit,
>
> Troy
>
>
> On 6/16/19 12:02 PM, pierre amadio wrote:
> > Hi there !
> >
> > Playing with the python3 Sword module I hit a problem that I did not
> > have with python2 when dealing with Strongs definition such as G1140
> > (daimonion). It looks like the 'æ' character is causing problem.
> >
> > This example works with python2, but generate an error when ran wiht python3:
> >
> > ##########
> > import Sword
> > library = Sword.SWMgr()
> > target=library.getModule("StrongsGreek")
> > vk=Sword.SWKey("1140")
> > target.setKey(vk)
> > strongEntry=target.renderText().getRawData()
> > ###########
> >
> > File "/usr/local/sword/python3/lib64/python3.4/site-packages/Sword.py",
> > line 128, in getRawData
> > def getRawData(self): return _Sword.SWBuf_getRawData(self)
> > UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position
> > 73: invalid continuation byte
> >
> > Anyone knows how to be able to catch the content of this entry in a
> > python variable ?
> >
> > _______________________________________________
> > sword-devel mailing list: sword-devel at crosswire.org
> > http://www.crosswire.org/mailman/listinfo/sword-devel
> > Instructions to unsubscribe/change your settings at above page
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list