Building up on @Araq's reply I would do:
    
    
    import unidecode
    
    import os
    proc findNimStdLib*(): string =
      ## Tries to find a path to a valid "system.nim" file.
      ## Returns "" on failure.
      try:
        let nimexe = os.findExe("nim")
        if nimexe.len == 0: return ""
        result = nimexe.splitPath()[0] /../ "lib"
        if not fileExists(result / "system.nim"):
          when defined(unix):
            result = nimexe.expandSymlink.splitPath()[0] /../ "lib"
            if not fileExists(result / "system.nim"): return ""
      except OSError, ValueError:
        return ""
    
    # Load the Unicode data file.
    loadUnidecodeTable(findNimStdLib() / "pure/unidecode/unidecode.dat")
    
    echo unidecode("Æneid") # AEneid
    
    
    Run

Ref: 
[https://scripter.co/notes/nim/#unidecode](https://scripter.co/notes/nim/#unidecode)

Related issue I just opened: 
[https://github.com/nim-lang/Nim/issues/8767](https://github.com/nim-lang/Nim/issues/8767)

Reply via email to