Get the App
SLTechnology News&Howtos  ›  Database  › 

How to translate Chinese into Hanyu Pinyin under mysql

Shulou Source: shulou.com Published: 2022-05-31 18:53:34 10月02日 Update

< LENGTH(NAME) DO SET tmp_lcode = SUBSTRING(NAME, lp, 2); SET lcode = CAST(ASCII(UNHEX(tmp_lcode)) AS UNSIGNED); SET tmp_rcode = SUBSTRING(NAME, lp + 2, 2); SET rcode = CAST(ASCII(UNHEX(tmp_rcode)) AS UNSIGNED); IF lcode >

128 THEN

SET mycode = 65536-lcode * 256-rcode

SELECT CONCAT (mypy,pin_yin_) INTO mypy FROM t_base_pinyin WHERE CODE_ > = ABS (mycode) ORDER BY CODE_ ASC LIMIT 1

SET lp = lp + 4

ELSE

SET mypy = CONCAT (mypy,CHAR (CAST (ASCII (UNHEX (SUBSTRING (NAME, lp, 2)) AS UNSIGNED)

SET lp = lp + 2

END IF

END WHILE

RETURN LOWER (mypy)

END

$

DELIMITER

-- Test function

Select to_pinyin (); select to_pinyin ()

Thank you for your reading. the above is the content of "how to translate Chinese into Hanyu Pinyin under mysql". After the study of this article, I believe you have a deeper understanding of how to translate Chinese into Hanyu Pinyin under mysql. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Pinyin Hanyu Pinyin Chinese Chinese functions Chinese characters learning content comparison table that is ideas situations data articles more knowledge knowledge points articles follow questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Shulou Tech Info MySQL Microsoft