dzcpy / transliteration

UTF-8 to ASCII transliteration / slugify module for node.js, browser, Web Worker, React Native, Electron and CLI.

Home Page:http://dzcpy.github.io/transliteration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Czech uppercase "Ý" is replaced by "U" instead of "Y"

panstromek opened this issue · comments

This code

console.log(transliterate('ýÝ'))

prints yU instead of yY

I tried to look at the code where to fix this but I couldn't figure it out, so here is at least bug report 😄 Thx for the great package.

commented

Thanks for raising the issue. I think the problem is that these characters are in a Cyrillic alphabet which shared with different langueages (I'm not excactly sure). One solution is that you can set a custom character map for these individual characters like this:

transliterate.setData({
  'Ý': 'Y'
});
transliterate('ýÝ')

In the next major version I may consider to find a better way to handle it