]> git.tdb.fi Git - libs/core.git/blobdiff - source/iso646fi.cpp
Add copyright notices and Id tags
[libs/core.git] / source / iso646fi.cpp
index 45c29ffb5dab08d1edc80075152af9b12c1b826f..1874ded8cf9eefd309f6c62fbf1a0ce0ae3bed2b 100644 (file)
@@ -1,11 +1,21 @@
+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
 #include "iso646fi.h"
 
 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 +37,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 +67,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)");
 }
 
 }