void JisX0208::Encoder::encode_char(unichar ucs, string &buf)
{
- unsigned short jis = ucs_to_jisx0208(ucs);
+ Kuten jis = ucs_to_jisx0208(ucs);
if(jis)
{
char jbuf[2];
- jbuf[0] = jis>>8;
- jbuf[1] = jis;
+ jbuf[0] = jis.ku+0x20;
+ jbuf[1] = jis.ten+0x20;
buf.append(jbuf, 2);
}
else
if(i==str.end())
return -1;
- string::const_iterator j = i;
+ auto j = i;
Kuten jis;
jis.ku = *j++-0x20;
Kuten result;
if(ucs_to_jisx0208_table[i].ucs==static_cast<unsigned short>(c))
{
- result.ku = (ucs_to_jisx0208_table[i].jis>>8)+1;
- result.ten = ucs_to_jisx0208_table[i].jis+1;
+ result.ku = (ucs_to_jisx0208_table[i].jis>>8);
+ result.ten = ucs_to_jisx0208_table[i].jis;
}
return result;