X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fwindows1252.cpp;h=bbd67536348894552e9163a9aaae664878cdd60e;hp=d809c3ff9bad7616a0e053f600edd72f2a207866;hb=5b1368cb791cab043f0435628cacbaff36e39b7b;hpb=36f9e78ae75f5e14b132f37d249340ad3480b8ce diff --git a/source/windows1252.cpp b/source/windows1252.cpp index d809c3f..bbd6753 100644 --- a/source/windows1252.cpp +++ b/source/windows1252.cpp @@ -21,19 +21,20 @@ unsigned short table[32]= } + namespace Msp { namespace Codecs { void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf) { if((ch>=0 && ch<=0x7F) || (ch>=0xA0 && ch<=0xFF)) - buf+=ch; + buf += ch; else { for(unsigned i=0; i<32; ++i) if(table[i]==ch) { - buf+=ch; + buf += ch; return; } @@ -43,7 +44,7 @@ void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf) void Windows1252::Encoder::transliterate(UnicodeChar, string &buf) { - buf+='?'; + buf += '?'; } @@ -52,16 +53,16 @@ UnicodeChar Windows1252::Decoder::decode_char(const string &str, string::const_i if(i==str.end()) return error("No input"); - int ch=static_cast(*i); + int ch = static_cast(*i); UnicodeChar result; if(ch>=0x80 && ch<=0x9F) { - result=table[ch-0x80]; + result = table[ch-0x80]; if(result==0) - result=error("Undefined Windows-1252 character"); + result = error("Undefined Windows-1252 character"); } else - result=ch; + result = ch; ++i; return result;