Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-1084

Error when saving utf-8 strings to database

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.1.2
    • 4.1.1
    • None
    • Ubuntu Server 20.04 LTS and Mac OS 12.4
      Node JS 16.14.2 LTS
    • 1
    • High

    Description

      Hello,
      after upgrading to Couchbase server 7.1 (from 7.0) and to Couchbase Node JS SDK 4.1 (from 3.2) , I can’t seem to save UTF-8 strings to the database properly.
      With the previous versions of Couchbase and the Node JS SDK, I had no issues and it seemed to support UTF-8 out of the box.
      With the latest versions, UTF-8 characters are not handled properly. For example, I am passing a JS object which has a property “5 Rue d’Estrées, 75007 Paris, France” to the Collection.insert method of the Node JS SDK, and in the database it is saved as “5 Rue d’Estrées, 75007 Paris, France”.

      Has something changed in the API or in the configuration since previous versions ? Should I downgrade to the previous versions or is there a configuration parameter that I am missing in order to save the JSON documents as UTF-8 to the database ?

      In the attached files we cans see that the strings for title property and location property are (1) entered in the app UI , (2) sent as UTF8 by the browser, (3) received and logged in the node console as UTF8, but (4) incorrectly saved in the database.

      Attachments

        1. 1_UI_Form_UTF8.png
          1_UI_Form_UTF8.png
          25 kB
        2. 2_Browser_Payload_UTF8.png
          2_Browser_Payload_UTF8.png
          130 kB
        3. 3_Node_Console_UTF8.png
          3_Node_Console_UTF8.png
          647 kB
        4. 4_Corrupted_String_Saved_in_DB.png
          4_Corrupted_String_Saved_in_DB.png
          110 kB
        5. 5_Reading_Back_UTF8.png
          5_Reading_Back_UTF8.png
          25 kB
        6. 6_Locale_Mac_OS.png
          6_Locale_Mac_OS.png
          109 kB
        7. 7_Locale_Ubuntu_Server.png
          7_Locale_Ubuntu_Server.png
          106 kB

        Issue Links

          Activity

            People

              brett19 Brett Lawson
              mfresh mfresh
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty