bson_as_json outputs illegal JSON for some locales

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 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.

        1. locale_test.cpp
          0.7 kB
          Roberto Sanchez

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

                Created:
                Updated: