Full anglehalf angle conversion function

xiaoxiao2021-03-06  40

A few days ago, in the OA web development process, a civil servant led a dedication, requiring me to convert the user's all-angle characters in the string to a unicode. Since I didn't understand this, I found that the Google search conversion function found that there were few articles in China involved related information. One of them is

http://www.jxyc.gov.cn/blog/withwolf/showlog.asp?log_id=468&cat_id=0

However, this function cannot handle the hybrid input problem, and it is wrong when the full angle is entered. Refer to the above program, combined with some Unicode Wide coding rules: Please refer to the following is the conversion program (javascript) / ************************* * Parameter Description: * Full angle -> Half-angle * STR: String to be converted * Return value type: string ********************************** ** /

Function DBC2SBC (STR) {VAR I; Var Result = '; for (i = 0; i = 65281 && code <65373) //" 65248 "is the conversion code distance Result = string.fromcharcode (Str.Charcodeat (i) -65248); Else Result = str.charat (i); Alert; Return Result;} / ************************************************************************************************************************************************************************************************************************************************************* To convert other special full-widgets, please refer to

Http://ha1.seikyou.ne.jp/Home/akairingosaita/hangul/dec-unicode-ks.txt

转载请注明原文地址:https://www.9cbs.com/read-86271.html

New Post(0)