X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fiso646fi.cpp;h=171c0a0a82780c1642d46c90e8d2b7b466bb68c2;hp=45c29ffb5dab08d1edc80075152af9b12c1b826f;hb=d2118ac101602cfe2d62fb7deb6ef3fcb0fe137b;hpb=dbda1bb7f44f289c9f1c5ba9741970ac264d8e5d diff --git a/source/iso646fi.cpp b/source/iso646fi.cpp index 45c29ff..171c0a0 100644 --- a/source/iso646fi.cpp +++ b/source/iso646fi.cpp @@ -4,8 +4,11 @@ using namespace std; namespace Msp { -void Iso646Fi::Encoder::encode_char(wchar_t c) +void Iso646Fi::Encoder::encode_char(wchar_t c_) { + // Win32 has typedef unsigned short wchar_t + int c=c_; + if((c>=0 && c<=0x5A) || c==0x5F || (c>=0x61 && c<=0x7A)) append(c); else if(c==0xC4) @@ -27,7 +30,7 @@ void Iso646Fi::Encoder::encode_char(wchar_t c) else if(c==0xFC) append(0x7E); else - throw CodecError("Can't express character in ISO-646-FI"); + error("Can't express character in ISO-646-FI"); } void Iso646Fi::Decoder::decode_char(const string &str, string::const_iterator &i) @@ -57,7 +60,7 @@ void Iso646Fi::Decoder::decode_char(const string &str, string::const_iterator &i else if(c<=0x7F) append(c); else - throw CodecError("Invalid ISO-646-FI string (undefined character)"); + error("Invalid ISO-646-FI string (undefined character)"); } }