Home Technique Internal Code

Internal Code



Introduction

InternalcodereferstothebinarycharactercodeusedinthecomputerChinesecharactersystem.Itistheexchangecodebetweenthecommunicationinput,outputandthesystemplatform.TheinternalcodecanachieveuniversalandhighThepurposeofefficienttransmissionoftext.Forexample,whatisstoredandcalledinMSWordisinternalcodeinsteadofgraphictext.EnglishASCIIcharactersarerepresentedbyaone-byteinternalcode.Chinesecharacterssuchasthenationalstandardcharacterset,GB2312,GB12345,andGB13000allusedouble-byteinternalcodes,GB18030(27,533Chinesecharacters)double-byteinternalcodeChinesecharactersare20,902,andtheremaining6,631Chinesecharactersuseafour-byteinternalcode.

Classification

Characterencoding:Thecharacterencodingisthebinarynumbercorrespondingtothecharactersofthecharacterset.ThemostcommonlyusedcharactersetisANSI,andthebinaryencodingcorrespondingtotheANSIcharactersetisCalledANSIcode,DOSandWindowssystemsbothuseANSIcode,butthecharactercodeusedinthesystemmustundergobinaryconversion,whichiscalledsysteminternalcode.

Chinesecharacterinternalcode:ANSIcodeisasinglebyte(8-bitbinarynumber)encodingset,whichcanonlyrepresent256charactersatmost,andcannotrepresentmanyChinesecharacters.TheANSIcodeofvariouscountriesandregionsOnthebasisofthis,avarietyofdifferentChinesecharacterencodingsetsaredesignedtobeabletohandlealargenumberofChinesecharacters.ThesecodesusesinglebytetorepresentANSIEnglishcharacters(thatis,compatiblewithANSIcode),andusedoublebytestorepresentChinesecharacters.SincetherecanonlybeoneChinesecharacterinternalcodeinasystem,thecharactersofotherChinesecharacterinternalcodescannotberecognized,whichcausescommunicationinconvenience.

GBcode:GBcodeisasimplifiedChinesecharactercodingschemeannouncedbythecountryin1980,andiswidelyusedinmainlandChinaandSingapore,alsoknownasthenationalstandardcode.Thenationalstandardcodeencodes6763Chinesecharactersets,coveringmostoftheChinesecharactersinuse.

GBKcode:GBKcodeisanextendedcharacterencodingofGBcode,whichencodesmorethan20,000simplifiedandtraditionalChinesecharacters.SimplifiedversionsofWin95andWin98bothuseGBKassysteminternalcode.

BIG5code:BIG5codeisaChinesecharacterencodingfortraditionalChinesecharacters,whichiscommonlyusedincomputersystemsinTaiwanandHongKong.

HZcode:HZcodeisaChinesecharactercodewidelyusedontheInternet.

ISO-2022CJKcode:ISO-2022isacodingstandardestablishedbytheInternationalStandardsOrganization(ISO)forvariouslanguagecharacters.Two-byteencodingisadopted,inwhichtheChineseencodingiscalledISO-2022CN,andtheJapaneseandKoreanencodingsarecalledJPandKRrespectively.Generally,thethreearecollectivelyreferredtoastheCJKcode.TheCJKcodeismainlyusedintheInternetnetwork.

Unicodecode:Unicodecodeisalsoaninternationalstandardcode,whichusestwo-byteencodingandisnotcompatiblewithANSIcode.Itisusedinthenetwork,Windowssystemandmanylarge-scalesoftware.

Internalcodeconversion

Duetohistoricalandregionalreasons,sometimesmultipleencodingschemesappearinonetext,especiallyChinesecharacters.Sincecharactersdifferentfromthesysteminternalcodecannotbedisplayednormallyinthesystem,theinternalcodeconversionofthecharactersmustbecarriedout,thatis,thecharactersthatarenotthesysteminternalcodeareconvertedintotheinternalcodecharactersthatcanberecognizedbythesystem.NJStarissuchanexcellentsoftware.OtherssuchasSitongLifang,MagicWin98,Cross-StraitCommunication,ChineseCharacterCommunication,etc.areallsuchinternalcodeconversiontools.

Mutualconversion

Theconversionrelationshipbetweenlocationcode,nationalstandardcodeandmachineinternalcode:

(1)Thelocationcodeisfirstconvertedintohexadecimalnumberrepresentation

(2)(Hexadecimalrepresentationoflocationcode)+2020H=nationalstandardcode;

(3)nationalstandardcode+8080H=machineinternalcode

Example:TakingtheChinesecharacter"大"asanexample,theareacodeof"大"is2083

Solution:1.Theareacodeis20,andthebitnumberis83

2.Thelocationnumber2083isconvertedtohexadecimalandexpressedas1453H

3,1453H+2020H=3473H,getthenationalstandardcode3473H

4,3473H+8080H=B4F3H,gettheinternalcodeB4F3H

Summary:Tworepresentationsofcharacterencoding:ASCII(characterrepresentation);GB2312(nationalstandardcode,Chinesecharacterencoding)

Relateddifferences

1.Theexternalcodeisthecharacteryouinputfromtheoutsideworld.Afterthischaracterisinput,therewillbeacorrespondinglocationcode(thatis,a94*94checkerboardgrid,theChinesecharacteryouinputwillcorrespondtoagridinside,row+columnisusThearea+locationhere),

2,thelocationcodecanbeconvertedintothenationalstandardcodeafterconversion(sothelocationcode→nationalstandardcodestepjustmeansconversion),

3,Thenationalstandardcodecanbeconvertedintotheinternalcode(usuallyrepresentedbyahexadecimalnumber)afterconversion.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP