# Compressing language for Game use to save Packets

Given ASCII is 8 bits (1 byte), UNICODE is 32 bits (4 bytes).

An idea came to my mind to support multiple language by isolating certain UNICODE Letters to support multiple language for my chat(game) program.

It will be composed of [4 bit (Language trigger)] + [8 bits (255 possible characters) x 16]

Example:

trig|message per character, each 8 bit is character depending on trigger, language changes
0001|00000000|00000000|00000000|00000000|00000000....


Trigger for characters: (example purpose only)

0001 Normal Latin
0010 European Latin
0011 Historic Latin
0100 Japanese
0101 Chinese
etc...


The characters at UNICODE not present at my list will make a special character... I'm thinking a Box (which will be present at the 0001 character list).

My in-built character table will supply the character depending on the trigger. Of course the User can only use one set of trigger and not mixed character using different triggers.

I also want to use this character for my Account Server Creation and Queries. Note that other character format do not support multi-language characters.

Result Comparison: Instead of sending 512 bits (32 bit x 16). I am actual sending 132 bits (4 bit + (8x16)) only.

Is this feasible and currently in use or am I doomed to use UNICODE? I am open for better ideas than the ones above.

• Why are you using 32 bits for storing UNICODE instead of just using UTF-8? – Sean Middleditch Apr 10 '15 at 2:08
• let me edit the question to give more example on what I want to achieve. – Ace Caserya Apr 10 '15 at 2:27
• I doubt 8 bits will be enough for languages like Chinese/Japanese, they have at least 2000 characters for basic reading, let alone other less common ones. – Qantas 94 Heavy Apr 10 '15 at 4:11
• @AlvinCaseria: this problem is already solved and the solution is called UTF-8. Use it over the wire. Use it on disk. Use it in memory. – Sean Middleditch Apr 10 '15 at 4:34
• My concerns about UTF-8 is stability of character stored on database, since I will use it for Account Queries. – Ace Caserya Apr 10 '15 at 5:15