Sunday, December 22, 2013

Which one to choose: 'UCS 0x80', 'UCS 0x81', or 'UCS 0x82'?


Step1. Whenever possible, use '0x81' format.

      Strong point  : '0x81' offers smallest number of memory required, 
                           i.e. (3 + N) bytes

      Weak point    : this format only works for character set containing 128 characters 
                            that lies between 'XX00' to 'XX7F', or between 'XX80' to 'XXFF'.


Step2. If '0x81' is impossible, try the '0x82' format

      Strong point  : '0x82' offers slightly bigger number of memory required compared

                           to '0x81' format,

                           i.e. (4 + N) bytes

      Weak point    : this format only works for character set containing 128 characters


Step3. If '0x81' and '0x82' is not possible, you must use '0x80'

      Strong point  : '0x80' can cover all UCS2 range from '0000' to 'FFFF'

      Weak point    : the number of bytes required is large, i.e. (1 + 2 * N) bytes

No comments:

Post a Comment