开发者

Unable to translate Unicode character '\uDA22'

Hi im retrieving registry data and whilst outputting to a file i came acros开发者_JAVA技巧s this. Im not 100% sure what it is, i would guess it is a registry value i captured. Is there any easy way i can eliminate this problem, preferable without deleting the data?


\uDA22 is part of a surrogate pair and should not appear on its own. If it does, your data is corrupted. Surrogate pairs are used only for rather exotic characters outside the basic multilingual plane. It seems a bit strange to find them in the registry, unless you're dealing with Chinese-language applications.

What encoding are you using to write the file? The error occurs either because your input contains corrupted UTF-16 data (though I suspect that the error message would be different then) or because the encoding you're using cannot represent those characters, which would be true for the default encoding on an English-language Windows. The easiest fix would be to use UTF-8 as encoding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜