Skip to content

Commit

Permalink
Merge pull request #44659 from Qrox/imbue
Browse files Browse the repository at this point in the history
Imbue scent map (de)serialization stream with the C locale
  • Loading branch information
ZhilkinSerg authored Oct 7, 2020
2 parents c1c07df + dac51d4 commit 5a0f553
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/savegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ void game::serialize( std::ostream &fout )

std::string scent_map::serialize( bool is_type ) const
{
std::stringstream rle_out;
std::ostringstream rle_out;
rle_out.imbue( std::locale::classic() );
if( is_type ) {
rle_out << typescent.str();
} else {
Expand Down Expand Up @@ -247,6 +248,7 @@ void game::unserialize( std::istream &fin )
void scent_map::deserialize( const std::string &data, bool is_type )
{
std::istringstream buffer( data );
buffer.imbue( std::locale::classic() );
if( is_type ) {
std::string str;
buffer >> str;
Expand Down

0 comments on commit 5a0f553

Please sign in to comment.