Hi, finally I could solve my problems. It wasn't related to UTF-8 at all =). It didn't check if module->getConfigEntry always returns something !=0. So there is one conf File that doesn't have a Lang entry: personal.conf. Because of this I got a corrupted JSON string.
But I went through the confs and (at least) the following confs aren't UTF-8 encoded: finpr.conf finpr92.conf rieger.conf spavnt.conf swe1917.conf ukjv.conf viet.conf wulfila.conf For this files I get wrong encoded characters. I think the reason for this is, that I compiled sword without-icu. For webOS I need to link all custom libraries statically. If I link ICU to my App the plugin size increase from ~800 KB to 20 MB. Do I need all icu libraries to get sword working with icu support? Thanks for all your help! Stephan Am 24.07.2011 17:09, schrieb Troy A. Griffitts: > Stephan, > > Sorry for my '.' instead of '->' in my examples. I've been in Java for > the past 3 weeks. > > Most everything is UTF-8 these days, but in our past world, when things > were much more mixed, the proper way to get UTF-8 back was to use the > module render filter and make sure your markup filter manager specified > which encoded you desire (it defaults to UTF-8, so you're good). So, > this should always give you UTF-8: > > SWMgr confReader("/media/internal/.sword/install", new > MarkupFilterMgr(FMT_HTMLHREF)); > ... > string description = > module->RenderText(module>getConfigEntry("Description")); > ... > > RenderText(const char *buffer) will use that module's render filters on > the buffer and return the processed result. > > The above MarkupFilterMgr will add all the correct filters to each > module to produce UTF-8 and HTMLHREF output, depending on the source > encoding and source markup. So you should always get what you've asked for. > > Troy > > > > > On 23/07/11 21:35, Stephan Tetzel wrote: >> Troy, >> >> First off all: Thank you for your suggestions. This help me a lot to get >> deeper into the SWORD library! >> >>> So webOS programming is pretty much all javascript with hooks to call >>> native library? That's pretty cool. >> >> Yes, it is =) >> >>> ___________________ >>> PDL_bool readConfs(PDL_JSParameters *parms) { >>> ... >>> SWMgr confReader("/media/internal/.sword/install"); >>> for (it = confReader.Modules.begin(); it != library.Modules.end(); it++) { >>> SWModule *module = it->second; >>> module.getConfigEntry("Lang"); >>> module.getConfigEntry("DataPath"); >>> module.getConfigEntry("Description"); >>> } >> >> I've tried to implement this code, but I have some encoding issues. Some >> conf files arn't encoded in UTF8 (e.g. gerlut1545.conf, it has ISO >> 8859-15 encoding). If I try to read the description I get "broken" >> character (e.g. for the german "Ü"). That's bad for my JSON parser, >> because it can't handle these characters. Is there a way to escape these >> non-unicode characters? >> >>> _______________________ >>> >>> InstallMgr class (and sword/utilities/installmgr.cpp as an example) >>> might be useful for remote and local installation of modules. >> >> Currently I download the raw zip (in Javascript over HTTP) and unzip it >> for myself. Is it possible to install a local file with InstallMgr? >> >> >>> Hope this helps. >> >> Yes, thanks again! >> >> Stephan >> >>> >>> On 23/07/11 14:24, Stephan Tetzel wrote: >>>> >>>> >>>> Am 23.07.2011 11:31, schrieb Peter von Kaehne: >>>>> On 21/07/11 08:09, Stephan Tetzel wrote: >>>>>> Hi, >>>>>> >>>>>> BibleZ HD is a port of one of my current webOS Apps >>>>>> (http://zefanjas.de/apps/biblez/) to the new webOS framework (enyo). The >>>>>> SWORD engine is now the new backend for this app. >>>>> >>>>> Where is the source? I see on your site nothing re GPL licensing >>>> >>>> BibleZ Pro (the current webOS (phone) App) doesn't use the SWORD Engine >>>> and isn't licensed under GPL. >>>> >>>> The new port (BibleZ HD) will be licensed under GPL. You can find the >>>> sources here[1]. (Sry that I haven't upload the sources immediately.) If >>>> you look at the sources you'll maybe notice, that I'm (very) new to the >>>> sword and c++ world =) >>>> >>>> Stephan >>>> >>>> [1]https://github.com/zefanja/biblez >>>> >>>> _______________________________________________ >>>> sword-devel mailing list: sword-devel@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@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@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@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@crosswire.org http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page