Comments (9)
@zhuangya 找到问题所在了:
mb_substr 的第3个参数 length
在 PHP < 5.4 的时候传 null
代表 0,5.4+ 代表不限制,截取到最后,所以旧的写法在 5.3 下转换后只剩下一个姓了:
- $string = $pinyin . mb_substr($string, mb_strlen($surname, 'UTF-8'), null, 'UTF-8');
+ $string = $pinyin . mb_substr($string, mb_strlen($surname, 'UTF-8'), mb_strlen($string, 'UTF-8') - 1, 'UTF-8');
from pinyin.
@zhuangya 同步了不过 PHP 5.3 有一个 bug,目前我手里没有 PHP 5.3 还没找到。晚点我再来解决。
from pinyin.
@zhuangya 哈哈,差点忘记了,还真是没更新呢
from pinyin.
可是 sae 还是有问题的版本 😕
from pinyin.
❯ http http://string2pinyin.sinaapp.com/\?str\=%E7%9B%96%E5%B0%8F%E5%A7%90
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json;charset:utf-8
Date: Sun, 22 May 2016 03:44:06 GMT
Server: nginx
Transfer-Encoding: chunked
Via: 10.67.15.22
X-Time-usage: 0.0897340774536
{
"result": [
"gai",
"xiao",
"jie"
],
"status": "T",
"str": "盖小姐"
}
这里应该是 ge xiao jie
才对呀
from pinyin.
http://string2pinyin.sinaapp.com/?str=%E7%9B%96%E5%B0%8F%E5%A7%90&api=name
from pinyin.
@zhuangya http://string2pinyin.sinaapp.com/doc.php
from pinyin.
原来是这样
thanks
On 5月 22 2016, at 11:48 中午, 安正超 <[email protected]> wrote:
@zhuangya
http://string2pinyin.sinaapp.com/doc.php—
You are receiving this because you were mentioned.
Reply to this email directly or [view it on GitHub](https://github.com/overtru
e/pinyin/issues/52#issuecomment-220812726)![](https://github.com/notifications
/beacon/AAedXo2nYHBZ8XC91m8ydnkXZpTqNT2iks5qD9IMgaJpZM4Ih5fY.gif)
from pinyin.
from pinyin.
Related Issues (20)
- 提取首字母小bug HOT 2
- Laravel 命名空间方式无法使用 PINYIN_UNICODE
- 可以添加遇到不能翻译的特殊字符如➕ 等。保持原样输出 HOT 3
- 名字“乐慧英”,拼音是lehuiying,而不是yuehuiying HOT 3
- 读音有误的感觉 HOT 2
- 5.0 语法设计 HOT 10
- Error in data HOT 3
- 保留标点不生效 HOT 4
- 安装版本要求太高,能否兼容 php 7 HOT 1
- 关于 女 这个 拼音 HOT 5
- 如何转首拼或者全拼的字符串中如果是1111 四个数字开头的字符串会转换失败,报错信息和代码我放下面了 HOT 5
- 多音字句子中的"家长" HOT 22
- $pinyin = Pinyin::polyphones('你电脑电脑电脑什么的',Converter::TONE_STYLE_NUMBER); HOT 1
- 腾讯云自动检测会报警 HOT 2
- 腾讯管家报毒:\overtrue\pinyin\bin\build HOT 3
- 取首字母时,能否保留完整的英文 HOT 1
- 「仆区」应该读 pú ōu 而非 pú qū HOT 5
- 请问一下4.x 版本支持单字返回多音吗? HOT 1
- 曾字应该读作zeng HOT 4
- 一直用4.1版本 内存型 速度非常快 循环5000次 也就几秒 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinyin.