diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-07 06:39:14 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-07 06:39:14 -0500 |
commit | c8bab6d1c6c36c67a5c354fb719474542f4f80b5 (patch) | |
tree | 443a5bab4f252c7dd79dec7269db3f031af4e2b5 /src | |
parent | 0cf9fbfbf8d7eb1c30369938c2239e31d44c9a4e (diff) | |
download | fork-ledger-c8bab6d1c6c36c67a5c354fb719474542f4f80b5.tar.gz fork-ledger-c8bab6d1c6c36c67a5c354fb719474542f4f80b5.tar.bz2 fork-ledger-c8bab6d1c6c36c67a5c354fb719474542f4f80b5.zip |
Throw an error if UTF-8 encoding is incorrect
Diffstat (limited to 'src')
-rw-r--r-- | src/commodity.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index a0827e7a..0d6c11c6 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -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; } |