]> git.tdb.fi Git - libs/core.git/blobdiff - source/stringcodec/iso2022jp.cpp
Use C++11 features with containers
[libs/core.git] / source / stringcodec / iso2022jp.cpp
index 14a4b99f83196b835b44eba00afb51082760d37a..296c1efe1ed479bd930a8b7f768d87b9a970d010 100644 (file)
@@ -40,7 +40,9 @@ void Iso2022Jp::Encoder::encode_char(unichar ch, string &buf)
                if(mode!=JISX0208)
                        switch_mode(JISX0208, buf);
 
-               char jbuf[2] = { jis.ku+0x20, jis.ten+0x20 };
+               char jbuf[2];
+               jbuf[0] = jis.ku+0x20;
+               jbuf[1] = jis.ten+0x20;
                buf.append(jbuf, 2);
        }
 }
@@ -89,7 +91,7 @@ unichar Iso2022Jp::Decoder::decode_char(const string &str, string::const_iterato
 
        while(i!=str.end())
        {
-               string::const_iterator j = i;
+               auto j = i;
 
                unichar result = -1;
                if(*j==033)