GithubHelp home page GithubHelp logo

nogizaka-call's People

Contributors

luminizeh avatar noooooorth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nogizaka-call's Issues

Unicode NFC or NFD?

部分歌名中含有假名的歌不能通过 pic.json 获取到封面。测试发现是仓库中部分歌曲的歌名是 NFD 模式,不能正确匹配 NFC 模式表示的字符。

在 Unicode 中,同一个字符可能有多种不同的编码,比如日语中的浊音符号 \u3099介绍),
部分假名与这个字符组合可以生成假名的浊化形式,比如 タ(\u30bf) 加上 \u3099 就可以组成 ダ(\u30bf\u3099)。除了 4 字节的表示形式, 还有一种 2 字节的表示形式 \u30c0。这两种模式,前者叫做 NFD,后者叫做 NFC。不仅仅是日语,其他带有浊音或者重音等发音变体形式的语言字符也存在这个问题。

由于读取方式的不同,Shell 不会区分这两种表达形式,而 Python 就会把它们区分开来(PyCharm 甚至把 ダ 表示两个等宽的字符)。

为了能在 Python 中正确的匹配字符,需要将模式统一成 NFC 模式或者 NFD 模式。

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.