Actions
Bug #7794
openWProgressBar can generate invalid HTML code.
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/22/2020
Due date:
% Done:
0%
Estimated time:
Description
The method WProgressBar::updateBar(...) uses locale-dependent function std::to_string to convert a double into a string. For some locals this can lead to the generation of invalid HTML code.
E.g. this code
`std::locale::global(std::locale("de_BE"));
auto pb = std::make_uniqueWt::WProgressBar();
pb->setValue(65);
Wt::WDialog dialog("ProgressBar");
dialog.contents()->addWidget(std::move(pb));
dialog.exec();`
generates the following HTML
<div id="barof0yz1o" class="Wt-pgb-bar" style="width:65,000000%;"></div>
Browser deactivates the style because the width is invalid.
Updated by Roel Standaert almost 3 years ago
Yeah, I haven't gotten around to eliminating all of these global locale dependent parts of Wt yet.
At the moment it is advised not to set a global locale when using Wt.
Actions