overtrue / pinyin

🇨🇳 基于词库的中文转拼音优质解决方案

Home Page:https://github.com/overtrue/pinyin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chenzhulin opened this issue · comments

代码行数大概在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);

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

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

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

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

image

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

解决了