Page 1 of 1

uniencode and xml

Posted: Sat May 24, 2014 4:36 am
by jameshale
my app uses the xml and zip libraries to unpack and read epubs.
In order to actually read the text correctly I have, at the suggestion of somewhere in the list) used the uniencode/decode construction as in...

Code: Select all

  --a text file so get its contents
         revZipExtractItemToVariable pArchive, sOPS & aMan[sNItemRef][href] , "temp"
         --process html
         put unidecode(uniencode(temp, "UTF8")) into temp
         put temp into aMan[sNItemRef][content_html]
Now I have not been able to test this properly under LC7 partly due to the funny error messages pointing who knows where but also because not all the epubs I can open under LC6.7 or less perform consistently under LC7.

I tried removing the "unidecode(uniencode(temp, "UTF8"))" line but that didn't work giving me errors in the XML.

So I don't know if this construction is now wrong, or the zip or XML libraries have changed.

First things first. Is "unidecode(uniencode(temp, "UTF8"))" still the right way to go or should I be doing something else?

Re: uniencode and xml

Posted: Sat May 24, 2014 6:33 am
by jameshale
Actually is the xml library working?

I am tracing my errors back to a call to "revCreateXMLtree"

trying to debug this as I trace (either into or over) I get ejected from the handler, the script and back into the calling script which promptly errors out as the script with the xml code has not completed.

tried wrapping it in a try/end try but it still jumps out.

testing LC7DP5 on the epub opener stack I submitted to LiveCodeShare a while ago.

not a happy stacky.

Re: uniencode and xml

Posted: Sat May 24, 2014 10:22 pm
by FourthWorld
The Release Notes for v7 list uniEncode and uniDecode as deprecated (with notes, on p14).

As for the XML part, if the problem is reproducible it may be good to submit the recipe in a bug report:
http://quality.runrev.com/

Re: uniencode and xml

Posted: Sun May 25, 2014 6:38 am
by jameshale
man I hate being called away while posting a reply.
nice long body of text just gone as my credentials seemed to expire.
Oh well.

I have done more work and can report there is definitely something weird with the script debugger.
Have no idea how to make it replicable without submitting my project (at least for now.)
Have also discovered anomalies in the revZIP library, or to be more correct, how LC7 is acting on the revZIP functions.
Will try to uncover more, resolve or post a test stack.