Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite "encoding" problem #649

Closed
ghost opened this issue Mar 17, 2017 · 5 comments
Closed

Sqlite "encoding" problem #649

ghost opened this issue Mar 17, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 17, 2017

Heya. First of all I wanna thank you for maintaining this awesome plugin.
I'm almost finishing my first Ionic App but still facing some problem when testing it on a Zenfone 2.
My DB rows were written in portuguese, and so there is a lot of accentuation.
My app seem to work fine on most cellphones but something is going weird when I deploy it on a Asus Zenphone 2 (androd 5.5), as you can see on the screenshots.

I'm using UTF-8 on sqlite. Have you ever faced something like that? Thanks a lot in advance.

anycellphone
asuszenfone2

@ghost ghost changed the title Sqlite "enconding" problem Sqlite "encoding" problem Mar 17, 2017
@brodycj
Copy link
Contributor

brodycj commented Mar 17, 2017

Hmm. I tested on a Samsung Galaxy J3 with Android 5.1.1 with some multi-byte UTF-8 characters in spec/www/spec/db-tx-string-test.js lines 462-498 OK:

        it(suiteName + 'UTF-8 string test', function(done) {
          if (isWP8) pending('SKIP for WP(8)');

          var db = openDatabase("UTF8-string-test.db", "1.0", "Demo", DEFAULT_SIZE);

          db.transaction(function(tx) {

            tx.executeSql("SELECT UPPER('Test ¢ é €') AS upper_result", [], function(ignored, rs) {
              if (isAndroid && (isWebSql || (isImpl2 && /Android [5-9]/.test(navigator.userAgent))))
                expect(rs.rows.item(0).upper_result).toBe('TEST ¢ É €');
              else
                expect(rs.rows.item(0).upper_result).toBe('TEST ¢ é €');

              // Close (plugin only) & finish:
              (isWebSql) ? done() : db.close(done, done);
            });
          });
        }, MYTIMEOUT);

        it(suiteName + 'UTF-8 string binding test', function(done) {
          if (isWP8) pending('SKIP for WP(8)');

          var db = openDatabase("UTF8-string-binding-test.db", "1.0", "Demo", DEFAULT_SIZE);

          db.transaction(function(tx) {

            tx.executeSql('SELECT UPPER(?) AS upper_result', ['Test ¢ é €'], function(ignored, rs) {
              if (isAndroid && (isWebSql || (isImpl2 && /Android [5-9]/.test(navigator.userAgent))))
                expect(rs.rows.item(0).upper_result).toBe('TEST ¢ É €');
              else
                expect(rs.rows.item(0).upper_result).toBe('TEST ¢ é €');

              // Close (plugin only) & finish:
              (isWebSql) ? done() : db.close(done, done);
            });
          });
        }, MYTIMEOUT);

Can you post a small, self-contained program that demonstrates this issue?

@brodycj
Copy link
Contributor

brodycj commented Mar 23, 2017

I have done some additional testing with accented characters with 100% success.

@brodycj brodycj closed this as completed Mar 23, 2017
@ghost
Copy link
Author

ghost commented Mar 23, 2017

My fault, I was too excited with my success that forgot to reply here. I've just changed the plugin from Cordova-sqlite-evcore-extbuild-free to this version here and everything magically worked with Intel processors.

There is probably a bug with evcore-extbuild-free plugin.

Thank you a lot and I apologize for my delay.

@aharslan
Copy link

@brunocollaco i'm using Cordova-sqlite-evcore-extbuild-free and facing the same issue. What branch you ended up using to solve this. I also need JSON queries support (JSON1 extension)

@brodycj
Copy link
Contributor

brodycj commented Mar 5, 2018

Cordova-sqlite-evcore-extbuild-free

storesafe/cordova-sqlite-evcore-extbuild-free#19

What branch you ended up using to solve this.

cordova-sqlite-storage (this one) and cordova-sqlite-ext

I also need JSON queries support (JSON1 extension)

Also available in cordova-sqlite-ext

P.S. I would like to add a gentle reminder that the ev*-free plugin versions are available under GPL or commercial license terms. The cordova-sqlite-storage (this one), cordova-sqlite-ext, cordova-sqlite-legacy, and cordova-sqlcipher-adapter plugin versions are available under permissive license terms. For more information about commercial license options please contact sales@litehelpers.net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants