Special and accented characters

前端 未结 4 405
情话喂你
情话喂你 2021-01-06 16:05

I am doing some work for a French client and so need to deal with accented characters. But I\'m running into a lot of difficulty, I am hoping the solution is simple and that

4条回答
  •  -上瘾入骨i
    2021-01-06 16:50

    Okay, so the first problem is you need to find out where the data is being lost.

    • Add appropriate logging of the unicode characters (ideally in hex) so you can see whether you can write to SQLite and retrieve the data correctly.
    • Hard-code some data so you can see whether it's coming back correctly
    • Make sure that anywhere you have a text-to-binary conversion, you specify an appropriate encoding (e.g. UTF-8)

    You haven't really said where things are going wrong, but I'd expect that if you sort out the character encoding, the rest should fall into place. Maybe SQLite has problems, but I doubt it...

提交回复
热议问题