Throw an error if UTF-8 encoding is incorrect
This commit is contained in:
parent
0cf9fbfbf8
commit
c8bab6d1c6
1 changed files with 2 additions and 2 deletions
|
|
@ -512,7 +512,7 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol)
|
|||
for (std::size_t i = 0; i < bytes; i++) {
|
||||
in.get(c);
|
||||
if (in.bad() || in.eof())
|
||||
break;
|
||||
throw_(amount_error, _("Invalid UTF-8 encoding for commodity name"));
|
||||
*_p++ = c;
|
||||
}
|
||||
}
|
||||
|
|
@ -526,7 +526,7 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol)
|
|||
if (c == '\\') {
|
||||
in.get(c);
|
||||
if (in.eof())
|
||||
break;
|
||||
throw_(amount_error, _("Backslash at end of commodity name"));
|
||||
}
|
||||
*_p++ = c;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue