|
return os << ' ' << gp.degrees << (unsigned char)186 << gp.minutes << '\'' << gp.seconds << '"'; |
This prints (unsigned char)186 to the output file, which in ISO-8859-1 is the same character as Unicode character U+00BA "Masculine Ordinal Indicator", as in 1º meaning primero in Spanish.
I think the character you intended to use is U+00B0 "Degree sign", which for ISO-8859-1 is encoded as a single character with the decimal value 176, not 186.
Maybe it would make sense to use "\u00B0" for that character, which is valid since C++11. However, the encoding used for that character would depend on compiler flags (GCC and Clang default to UTF8 for the ordinary literal encoding, MSVC ... probably doesn't), so the character written to demo_output.txt would also depend on those flags and so would not be portable.
Using (unsigned char)176) would be portable, and would at least be the correct symbol when the output is treated as ISO-8859-1.
serialization/example/demo.cpp
Line 66 in 097a6c6
This prints
(unsigned char)186to the output file, which in ISO-8859-1 is the same character as Unicode character U+00BA "Masculine Ordinal Indicator", as in 1º meaning primero in Spanish.I think the character you intended to use is U+00B0 "Degree sign", which for ISO-8859-1 is encoded as a single character with the decimal value 176, not 186.
Maybe it would make sense to use
"\u00B0"for that character, which is valid since C++11. However, the encoding used for that character would depend on compiler flags (GCC and Clang default to UTF8 for the ordinary literal encoding, MSVC ... probably doesn't), so the character written todemo_output.txtwould also depend on those flags and so would not be portable.Using
(unsigned char)176)would be portable, and would at least be the correct symbol when the output is treated as ISO-8859-1.