Nimrod / lib / pure / unicode.nim defines irune as int, while it's 64-bit on 64-bit targets, this is wrong, as UCS-4/UTF-32 code point is 32 bits and there only 24-bit code points allowed... The rest of procs also assume utf-8 can contain more than 4 bytes per code point, that's wrong because it's reduced to be compatible with UTF-16...
p.s. code unit = int8 for utf8, int16 for UTF16 etc., code point is 32-bit, i.e. fully describes a font character. (Although a string is needed to describe a composed character...)
And Nimrod / lib / system / widestrs.nim contains copy-pasta from unicode.nim
Also widestrings are not portable and this way are discouraged for crossplatform development. It is not supported on iOS for example (vwsprintf and friends just strip higher (>=0x1FF) bits of wchar_t) that brought several hours of pain debugging our game localization =)
So that I finally agree with http://utf8everywhere.org/ . This site has a lot of recipes for common cases and how unicode should be done in windows the portable way.