|
Line
Link Here
|
|
-- |
|
|
| 1 |
libycp/src/YCPBuiltinFloat.cc | 19 ++++++++++++++++++- |
|
libycp/src/YCPBuiltinFloat.cc | 19 ++++++++++++++++++- |
| 2 |
1 file changed, 18 insertions(+), 1 deletion(-) |
1 |
1 file changed, 18 insertions(+), 1 deletion(-) |
| 3 |
-- a/libycp/src/YCPBuiltinFloat.cc |
2 |
++ b/libycp/src/YCPBuiltinFloat.cc |
|
Lines 265-270
Link Here
|
| 265 |
return ret; |
265 |
return ret; |
| 266 |
} |
266 |
} |
| 267 |
|
267 |
|
|
|
268 |
// bnc#683881 |
| 269 |
static std::string nbsp_fixed_string (const std::string& str) |
| 270 |
{ |
| 271 |
std::string s; |
| 272 |
const char *p; |
| 273 |
unsigned char prev; |
| 274 |
|
| 275 |
p = str.c_str(); |
| 276 |
for (; *p; p++) { |
| 277 |
// fix invalid NBSP in ru or fi locales |
| 278 |
if (prev == 0xc2 && (unsigned char)*p < 0x80) |
| 279 |
s += (char)0xa0; |
| 280 |
s += *p; |
| 281 |
prev = *p; |
| 282 |
} |
| 283 |
return s; |
| 284 |
} |
| 268 |
|
285 |
|
| 269 |
// bnc#460094 |
286 |
// bnc#460094 |
| 270 |
static YCPValue |
287 |
static YCPValue |
|
Lines 289-295
Link Here
|
| 289 |
ss.imbue (std::locale ("")); |
306 |
ss.imbue (std::locale ("")); |
| 290 |
ss.precision (precision->value ()); |
307 |
ss.precision (precision->value ()); |
| 291 |
ss << fixed<< f->value (); |
308 |
ss << fixed<< f->value (); |
| 292 |
YCPString ret (ss.str ()); |
309 |
YCPString ret (nbsp_fixed_string (ss.str ())); |
| 293 |
|
310 |
|
| 294 |
return ret; |
311 |
return ret; |
| 295 |
} |
312 |
} |