Kanji string lengths - Sybase Infocenter

文章推薦指數: 80 %
投票人數:10人

At the mainframe, the length of graphic-type strings is counted in double-byte (16-bit) characters. Thus, a string of 10 kanji characters has a length of 10. At ... MainframeConnect15.0>MainframeConnectServerOptionProgrammer'sReferenceforCOBOL>Topics>ProcessingJapaneseclientrequests>DatatypesusedwithJapanesecharacters    Chapter2:Topics Kanjistringlengths Kanjicharactersarerepresentedascharacter-typedataat theworkstation,andaseithercharacter-typeorgraphic-typedata atthemainframe.ThelengthofaJapanesecharacterstringdepends onwhichworkstationisbeingusedandwhetherthedatatypeisgraphic orcharacter. Somecharactersetsuseaspecialindicatororcodeincharacter-type stringstoannouncethatthefollowingseriesofcharactersare double-bytecharacters.Withkanji,thisindicatoriscalledaShift Out(SO)code.AnSOcodemarksthebeginningofadouble-bytekanji string.TheendofthekanjistringismarkedbyaShiftIn(SI) code. WhensettingfieldlengthsforJapanesecharacterstrings, youmustincluderoomfortheseSO/SIcodes. Whensendingdatafromamainframetoaworkstation,youcan replaceSO/SIcodeswithblanksbycallingtheGateway-Library functionTDSETSOIbeforereceivingorsending data. GraphicdatatypesdonotuseSO/SIcodes. WARNING! Whenreceivingdatafromaworkstationcharacter setthatdoesnotuseSO/SIcodes,IBM_Kanjialways insertstheSO/SIcodesatthebeginningandendofdouble-byte characterstrings.Ifthefieldlengthspecificationdoesnottake thisintoaccount,andthelengthisjustlongenoughforthedata itself,someofthedataislost. Ifafieldcontainsmixedsingle-byteanddouble-bytedatainmore thanonekanjistring,anSO/SIpairexistsforeachkanji string. Atthemainframe,thelengthofgraphic-typestringsiscounted indouble-byte(16-bit)characters.Thus,astringof10kanjicharacters hasalengthof10. Attheworkstation,thelengthofkanjicharacterstrings iscountedinbytes.Thus,astringof10kanjicharactershasa lengthof20. Copyright©2007.SybaseInc.Allrightsreserved. ViewthisdocumentasPDF  



請為這篇文章評分?