overtrue / pinyin

🇨🇳 基于词库的中文转拼音优质解决方案
https://github.com/overtrue/pinyin
MIT License
4.32k stars 767 forks source link

如何转首拼或者全拼的字符串中如果是1111 四个数字开头的字符串会转换失败,报错信息和代码我放下面了 #193

Closed chenzhulin closed 1 year ago

chenzhulin commented 1 year ago

代码行数大概在100行左右 报错信息:iconv(): Detected an illegal character in input string

$string = "1224旺仔QQ糖"; $goods_initials = (new PinYin())->getFirstPY($string); $goods_initials_all = (new PinYin())->getAllPY($string);

var_dump($goods_initials,$goods_initials_all);

overtrue commented 1 year ago

你确定你用的 pinyin 库是我写的?

overtrue commented 1 year ago

这个 getFirstPYgetAllPY 应该没有在我的这个库里存在过哈

chenzhulin commented 1 year ago

Owner 哈哈哈弄错了,这个不是大佬你写的,抱歉抱歉

chenzhulin commented 1 year ago

但是大佬我用你这个工具包也有点问题 image

image

输出的内容也不对应数字没有输出

chenzhulin commented 1 year ago

解决了