Fixing the locale handling for doubles encoding/decoding