Code Monkey home page Code Monkey logo

Comments (9)

overtrue avatar overtrue commented on May 25, 2024 2

@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.

overtrue avatar overtrue commented on May 25, 2024 1

@zhuangya 同步了不过 PHP 5.3 有一个 bug,目前我手里没有 PHP 5.3 还没找到。晚点我再来解决。

from pinyin.

overtrue avatar overtrue commented on May 25, 2024

@zhuangya 哈哈,差点忘记了,还真是没更新呢

from pinyin.

zhuangya avatar zhuangya commented on May 25, 2024

可是 sae 还是有问题的版本 😕

from pinyin.

zhuangya avatar zhuangya commented on May 25, 2024
❯ 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.

overtrue avatar overtrue commented on May 25, 2024

@zhuangya

http://string2pinyin.sinaapp.com/?str=%E7%9B%96%E5%B0%8F%E5%A7%90&api=name

from pinyin.

overtrue avatar overtrue commented on May 25, 2024

@zhuangya http://string2pinyin.sinaapp.com/doc.php

from pinyin.

zhuangya avatar zhuangya commented on May 25, 2024

原来是这样

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.

overtrue avatar overtrue commented on May 25, 2024

@zhuangya 😄

from pinyin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.