libmpdclient icon indicating copy to clipboard operation
libmpdclient copied to clipboard

mpd_send_seek_current(mpd, 0.0, false) error in French locale: "Float expected: 0,000"

Open be1 opened this issue 11 months ago • 0 comments

Using mpd_send_seek_current (mpd, 0.0, false) with an application in french locale always gives an error from music player daemon: "Float expected: 0,000".

Currently, in mpd_send_seek_current(), libmpdclient serializes the float parameter to a string using a sprintf-like function:

https://github.com/MusicPlayerDaemon/libmpdclient/blob/08e3c02278f98c94a5cff9b92308b9c98ad7fb03/src/player.c#L196

In french locale, the string generated for (float) 0.0 is "0,0" (note the use of the comma, not dot) because the sprintf-like function supports locales. This should not.

be1 avatar Feb 22 '25 08:02 be1