bson_as_json outputs illegal JSON for some locales

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • 🔵 Done
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Many of the bson_as_json visitor functions delegate the work of converting a non-string value to a string to printf (by way of bson_string_append_printf). In certain locales, printf can return strings where a number with a floating point uses a comma instead of a period:

      { "value" : { "$numberDouble" : "1,1000000000000000888" } }
      

      JSON does not accept comma separators in numeric types, only decimal point separators.

            Assignee:
            Roberto Sanchez
            Reporter:
            Samantha Ritter (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: