Chinese character location code and machine internal code learning notes

Source: Internet
Author: User

I have studied Chinese character encoding, including the Chinese character location code and internal machine code. It is very interesting and practical. Generally, we use the location code in the cards. For example, the location code of "Ma" is 3477, then we will apply 3477, and then the host machine will be able to recognize Chinese Characters Based on the location code. The internal code is the internal code of the host, which is usually less commonly used, the internal code of the "Trojan" is 49901. You can try it: Open notepad, press the "Alt" Key, do not loosen it, and press 49901 in sequence to release the "Alt ", the word "horse" is displayed! Haha, amazing! Other Chinese characters or letters including symbols can be entered in this way. When you enter your name in the future, you can "show" it. Haha, without calling the input method, you can press a few numbers to name it, and it is accurate! Sometimes it takes a long time to use the input method! Haha! Then, how can we quickly get the location code and inner code of our name? To solve this problem, I specialized in character encoding and made a small part after knowing the conversion rules.ProgramTo everyone! Haha, open source again!

In other words, if you are too lazy to compile it on your own, please download it from my online disk. It may be an unexpected surprise.: Http://ma6174.ys168.com/

# Include <stdio. h>

# Include < String . H>
Int Main ()
{
Char A [ 1000000 ];
Int Neima1, neima2, neima, Len, quweima1, quweima2, quweima;
Printf ( "\ T Chinese character transcoding program ---------- ma6174 Development \ n " );
Printf ( " Enter \ n " );
While (Gets ()! = NULL)
{
Printf ( " \ N characters \ t machine internal code \ t Location Code \ n " );
Len = strlen ();
For ( Int I = 0 ; I <Len; I ++)
{
If (A [I] < 0 ){
Neima1 = A [I]- 0xffffff00 ;
Quweima1 = A [I] + 128 - 32 ;
I ++;
Neima2 = A [I]- 0xffffff00 ;
Quweima2 = A [I] + 128 - 32 ;
Neima = neima1 * 16 * 16 + Neima2;
Printf ( " % C \ t % d \ t % 02d % 02d \ n " , A [I- 1 ], A [I], neima, quweima1, quweima2 );
}
Else {
Printf ( " % C \ t % d \ n " , A [I], a [I]);
}
}
Printf ( " \ N enter \ n " );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.