Skip to content

Invalid JSON when using non-English LC_NUMERIC

When running the HTTP interface with a locale that does not use a dot for the decimal point, it will generate invalid JSON when it has to return a floating point number.

For example, with the Slovak locale, I get this from /requests/status.json:

{
  "fullscreen":0,
  "stats":{
    "inputbitrate":0,040203247219324,
    "sentbytes":0,
    "lostabuffers":2,
    "averagedemuxbitrate":0,
    "readpackets":8159,
    "demuxreadpackets":0,
    "lostpictures":0,
    "displayedpictures":0,
    "sentpackets":0,
    "demuxreadbytes":8353958,
    "demuxbitrate":0,039999961853027,
    "playedabuffers":7994,
    "demuxdiscontinuity":0,
    "decodedaudio":7994,
    "sendbitrate":0,
    "readbytes":8356608,
    "averageinputbitrate":0,
    "demuxcorrupted":0,
    "decodedvideo":0
  },
  "audiodelay":0,
  "apiversion":3,
  "time":207,
  "volume":256,
  "length":602,
  "random":false,
  "audiofilters":{
    "filter_0":""
  },
  "rate":1,
  "videoeffects":{
    "hue":0,
    "saturation":1,
    "contrast":1,
    "brightness":1,
    "gamma":1
  },
  "state":"playing",
  "loop":false,
  "version":"2.0.5 Twoflower",
  "position":0,34441769123077,
  "information":{
    "titles":[],
    "chapters":[],
    "category":{
      "meta":{
        "album":"The Golden Sun of the Great East",
        "title":"Final Frontier",
        "filename":"http://muziq.eu/media/file/5121",
        "artist":"Juno Reactor"
      },
      "Stream 0":{
        "Bitrate":"320 kb/s",
        "Type":"Audio",
        "Channels":"Stereo",
        "Sample_rate":"44100 Hz",
        "Codec":"MPEG Audio layer 1/2/3 (mpga)"
      }
    }
  },
  "repeat":false,
  "subtitledelay":0,
  "equalizer":[]
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information