1. Japanese kanji is a two-byte postal code, which is encoded in a 13-byte binary code.
The conversion steps are as follows:
1. For characters with JIS values between 8140 (HEX) and 9ffc (HEX:
A) subtract 8140 (HEX) from the JIS value to be converted );
B) Multiply the high byte by C0 (HEX );
C) add the data generated by step B to the low byte;
D) convert the result to a 13-bit binary string.
2. For characters whose JIS value is e040 (HEX) to ebbf (HEX:
A) subtract the JIS value to be converted from c140 (HEX );
B) Multiply the high byte by C0 (HEX );
C) add the data generated by step B to the low byte;
D) convert the result to a 13-bit binary string.
2. The conversion steps for Chinese and Japanese Chinese characters are similar:
1. The first byte is 0xa1 ~ Between 0xaa, the second byte is 0xa1 ~ Characters Between 0xfe:
A) first byte minus 0xa1;
B) Multiply the previous result by 0x60;
C) The second byte minus 0xa1;
D) add the result of step B to the result of Step C;
E) convert the result to a 13-bit binary string.
1. The first byte is 0xb0 ~ Between 0xfa and the second byte is 0xa1 ~ Characters Between 0xfe:
A) the first byte minus 0xa6;
B) Multiply the previous result by 0x60;
C) The second byte minus 0xa1;
D) add the result of step B to the result of Step C;
E) convert the result to a 13-bit binary string.