Issue on writing wstring to a file for hebrew/arabic language

笑着哭i 提交于 2019-12-06 07:15:43

The problem with wofstream is that it accepts the wide string for the open() method but does not actually write wide characters to the file. You have to be explicit about that and imbue() it with a locale that has a codecvt with the encoding you want. Implementation of such a codecvt that produces a UTF encoding is still spotty, here's an example that uses Boost.

It's been a while since I've used xerces, but I remember that XMLCh are their special character types, and probably you must convert them to wchar before writing. Alternatively you can try to save it byte by byte.. Good Luck!

as far as i know (obout arabic) you have to write oppositely since its from right to left so write a code to switch the letters before writing it to a file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!