]> git.tdb.fi Git - libs/core.git/blobdiff - source/latin1.cpp
Add copyright notices and Id tags
[libs/core.git] / source / latin1.cpp
index fe9e1a4170e1893d86574d2f916c3b7722e5f369..fcff15f036c55f2e91b85fb23c42d0df52b16bd6 100644 (file)
@@ -1,14 +1,24 @@
+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
 #include "latin1.h"
 
 using namespace std;
 
 namespace Msp {
 
-void Latin1::Encoder::encode_char(wchar_t c)
+void Latin1::Encoder::encode_char(wchar_t c_)
 {
+       // Win32 has typedef unsigned short wchar_t
+       int c=c_;
        if(c<0 || c>0xFF)
-               throw CodecError("Can't express character in Latin-1");
-       append(c);
+               error("Can't express character in Latin-1");
+       else
+               append(c);
 }
 
 void Latin1::Decoder::decode_char(const string &str, string::const_iterator &i)