jxcore / jxcore-cordova

JXcore / Node.JS plugin for Apache Cordova / PhoneGap
Other
233 stars 68 forks source link

How to make the built-in sqlite3 support UTF8 encoding? #138

Closed AlexZhouAA closed 8 years ago

AlexZhouAA commented 8 years ago

This should be a significant issue since there're people who need store Chinese, Japanese or Korean information in sqlite db. Unfortunately, if they do so, they'll retrieve scrambled characters when query from database.

And I found #107 where @ktrzeciaknubisa says jx V8 works OK without this issue. I followed the instructions at https://github.com/jxcore/jxcore/blob/master/doc/Android_Compile.md#compile-as-a-static-library and https://github.com/jxcore/jxcore-cordova#updating-jxcore-binaries-optional The process was pretty smooth before I tried to recompile .so files. I got error as below,

Android NDK: ERROR:/home/zhou/Downloads/jxcore-cordova/src/android/jni/Android.mk:mozjs: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that /home/zhou/Downloads/jxcore-cordova/src/android/jni/../jxcore-binaries/libmozjs_arm.a exists  or that its path is correct   
/home/zhou/Downloads/androidNDK/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

Then, I found #12. I can tell currently I can't replace JXcore binaries from sm to v8.

So now, what can I do to make the built-in sqlite3 support UTF8 encoding? It's essential to my project. Is there any other way to deal this?

Thanks in advance.

ktrzeciaknubisa commented 8 years ago

Then, I found #12. I can tell currently I can't replace JXcore binaries from sm to v8.

Indeed, currently only SM can be used with jxcore-cordova

So now, what can I do to make the built-in sqlite3 support UTF8 encoding?

Right now probably the best way for you would be e.g. to encode base64 data before putting into database an decode while reading.

AlexZhouAA commented 8 years ago

Thanks, I'll try that.

voxsoftware commented 8 years ago

Este módulo que hice soluciona el problema. Simplemente se llama require("sqlite-mobile-fix"); después de require("sqlite") y listo. Saludos

2016-02-15 16:21 GMT-05:00 AlexZhouAA notifications@github.com:

Thanks, I'll try that.

— Reply to this email directly or view it on GitHub https://github.com/jxcore/jxcore-cordova/issues/138#issuecomment-184401730 .

jhernancanom commented 7 years ago

Hello, friends. I am interested in info about SQLite3 and UTF8. Where can I find sqlite-mobile-fix for reading and understanding the solution? Thanks.