[[ Bug 12360 ]] open file as utf-8 doesn't work exactly as documented

The branch also implements the UTF-32 conversion from a StringRef