Interesting observation (and worth a github issue!), but as far as I'm concerned that ``fwrite`` is correct and ``fputs`` must not do any encoding conversions either. Either set the codepage to UTF-8 or use Nim's ``encodings`` module.