How to translate Chinese into Hanyu Pinyin under mysql
< 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!