In my case, I recently picked up the irrKlang library which allows me to work with audio files without doing too much work. Then I ran into the issue where unicode characters in filepaths were not supported by the library. It either reads it incorrectly (I would’ve thought even if it was read wrong, it could still find the file), or simply ignores it, leaving me with invalid file paths.
Searched their support forums for a solution to this, but all I got out of it was “unicode? uhhh why not just use ascii?” kind of attitude towards unicode, which I suppose is not uncommon.
What are some techniques that I could use to reliably pass unicode strings to libraries that don’t have unicode support?
Simply put you don’t, you can pass through them using a byte array, and then interpret it back as a unicode array on the other end, but if it doesn’t do unicode, it doesn’t do unicode.
There is no point in passing a unicode string to a library that is incapable of interpreting it.
If you need to do something specific(like using a load command on a filesystem with unicode paths e.g HFS+), then don’t. Rather use the system provided file APIs and push the data into the uncooperative libraries constructor.
If you’re seriously having problems with this unicode file path business, cause you don’t work well with passing addresses and bitstreams around, then a simple solution is to make your own function: