X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fiso885915.cpp;fp=source%2Fiso885915.cpp;h=3eccbcf91e436105d9b0e17e4367b13df3a659fe;hp=b0fc2efed95ab3fec4c7e4f129d884bdc3524ebd;hb=5b1368cb791cab043f0435628cacbaff36e39b7b;hpb=36f9e78ae75f5e14b132f37d249340ad3480b8ce diff --git a/source/iso885915.cpp b/source/iso885915.cpp index b0fc2ef..3eccbcf 100644 --- a/source/iso885915.cpp +++ b/source/iso885915.cpp @@ -12,7 +12,7 @@ using namespace std; namespace { -const unsigned map_size=8; +const unsigned map_size = 8; const int mapping[map_size*2]= { @@ -28,22 +28,23 @@ const int mapping[map_size*2]= } + namespace Msp { namespace Codecs { void Iso885915::Encoder::encode_char(UnicodeChar ch, string &buf) { - int tch=transform_mapping_or_direct(mapping, map_size, ch, false); + int tch = transform_mapping_or_direct(mapping, map_size, ch, false); if(tch<0 || tch>0xFF) error(ch, buf, "Can't express character in ISO-8859-15"); else - buf+=tch; + buf += tch; } void Iso885915::Encoder::transliterate(UnicodeChar, string &buf) { - buf+='?'; + buf += '?'; } @@ -52,14 +53,14 @@ UnicodeChar Iso885915::Decoder::decode_char(const string &str, string::const_ite if(i==str.end()) return error("No input"); - unsigned char ch=*i; - int tch=transform_mapping_or_direct(mapping, map_size, ch, true); + unsigned char ch = *i; + int tch = transform_mapping_or_direct(mapping, map_size, ch, true); UnicodeChar result; if(tch==-1) - result=error("Undefined ISO-8859-15 character"); + result = error("Undefined ISO-8859-15 character"); else - result=tch; + result = tch; ++i; return result;