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

Supporting UTF - 8 #17

Open
ZuzooVn opened this issue Oct 20, 2017 · 7 comments
Open

Supporting UTF - 8 #17

ZuzooVn opened this issue Oct 20, 2017 · 7 comments

Comments

@ZuzooVn
Copy link

ZuzooVn commented Oct 20, 2017

As we already discussed here: QEWD-Courier/Ripple-Qewd#40

How can setDocument() support UTF 8?

Thanks

@linto17
Copy link

linto17 commented Nov 29, 2017

Hi, is this fixed?

@ZuzooVn
Copy link
Author

ZuzooVn commented Dec 1, 2017

@linto17
I created the pull request here: #18

@dileep-ehr
Copy link

Hi,

There seems to be a relates issue discussed in the following thread. Though it is about using YottaDB, the problem is very similar to what is reported here.
https://groups.google.com/forum/#!topic/enterprise-web-developer-community/5yXC166Qh78

In one of the replies Rob mentions that he has understood the issue and will be able to explain how to configure QEWD to address this problem. Has this been posted somewhere? If not can somebody post it here for everybody's benefit? Many people seem to be having this problem

@killmenot
Copy link
Contributor

@dileep-ehr I believe Rob wants setDocument/getDocument were not affected by changes in #18 if it's not needed. Let me try to patch solution #18 and add tests and then I will ping Rob

@dileep-ehr
Copy link

dileep-ehr commented Oct 9, 2018 via email

@killmenot
Copy link
Contributor

#20 should fix it and seems other functionality works correctly at least in 3 db (redis, gtm and memory). Thanks to @ZuzooVn and his workaround.

I will talk with Rob to merge it but now sure when

@killmenot
Copy link
Contributor

UTF-8 should be already supported on configuration level.

Here is a configuration I use for run gtm tests

  const Gtm = require('nodem').Gtm;
  const db = new Gtm();
  const options = {
    mode: 'strict',
    charset: 'utf-8'
  };
  db.open(options)

And this test case works for me well:

var expected = {
  baz: 'Thắng Nguyễn'
};

var foo = {
  baz: 'Thắng Nguyễn'
};

documentNode.$('foo').delete();
documentNode.$('foo').setDocument(foo);

var actual = documentNode.$('foo').getDocument();

expect(actual).toEqual(expected);

Other db providers are not tested but I know that redis db provider lib needs to be updated to support this

NOTE: Read more about character encoding here: https://github.com/dlwicksell/nodem#important-notes

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

No branches or pull requests

4 participants