Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions engine/report/report_html_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,20 +1164,37 @@ void print_profilesets( std::ostream& out, const profileset::profilesets_t& prof
out << "</div>";
}

/* Main function building the html document and calling subfunctions
*/
void print_html_( report::sc_html_stream& os, sim_t& sim )
void set_global_locale()
{
// Set global locale to en-US for consistent number formatting
try
for ( const auto& name :
{
std::locale::global( std::locale( "en_US.UTF-8" ) );
}
catch ( const std::runtime_error& )
"en_US.UTF-8",
"en_US.utf8",
"English_United States.65001",
"en_US",
"en-US",
"English_United States.1252",
"C"
} )
{
// backup spelling for CI
std::locale::global( std::locale( "en_US.utf8" ) );
try
{
std::locale::global( std::locale( name ) );
return;
}
catch ( const std::runtime_error& )
{ }
}
std::locale::global( std::locale::classic() );
}

/* Main function building the html document and calling subfunctions
*/
void print_html_( report::sc_html_stream& os, sim_t& sim )
{
// Set global locale formatting
set_global_locale();

// Set floating point formatting
os.precision( sim.report_precision );
Expand Down
Loading