Unidecode
Unicode -> ASCII converter package for Arturo
What does this package do?
Let's say you have a Unicode string, with different characters, in different languages, e.g. characters with accents, in cyrillic, Mandarin Chinese, etc and - for whatever reason - want to have a close approximation to what it would be like using only ASCII characters, then this package is for you.
Tip
The package has been based on Nim's implementation, of the same name - which in turn has been based on Python's Unidecode module by Tomaž Šolc, itself a port of Perl's Text::Unidecode by Sean M. Burke - and that's where the transliteration data (src/data.txt) comes from.
How do I use it?
Simply import it and use the included unidecode function:
import "unidecode"!
print unidecode "доброе утро!"
; will print:
; dobroe utro!
Important
The package cannot possibly guarantee that the output will be "accurate", nor is it 100% easy to say what would be accurate in every possible case - it's an approximate Unicode -> ASCII transformation. So, if you need a better solution for your specific needs, you might be better off writing a custom solution yourself!
Limitations
- Only characters within the Basic Multilingual Plane (U+0000 to U+FFFF) are supported - anything beyond that (e.g. emoji, rare CJK ideographs, mathematical alphanumeric symbols, etc) is silently removed
- Han characters are always transliterated using their Mandarin reading - regardless of whether they are Chinese hanzi, Japanese kanji or Korean hanja (e.g.
日本becomesRi Ben, notNihon)
License
MIT License
Copyright (c) 2026 Yanis Zafirópulos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The transliteration data (src/data.txt) has been derived from Nim's unidecode
module, itself based on Python's Unidecode by Tomaž Šolc and Perl's
Text::Unidecode by Sean M. Burke.
| 1.0.0 | 31 October 2026 | 245215 / 9 files |
| 0.0.3 | 30 April 2024 | 239128 / 6 files |
| 0.0.2 | 12 February 2024 | 238804 / 5 files |
| 0.0.1 | 12 February 2024 | 239214 / 5 files |
No dependencies.