开发者

Chinese writing when writing to files?

开发者 https://www.devze.com 2023-03-07 10:12 出处:网络
Using Ruby and Windows Vista, I sometimes get what look likes Chinese writing - parti开发者_如何学Gocularly when writing to HTML files.

Using Ruby and Windows Vista, I sometimes get what look likes Chinese writing - parti开发者_如何学Gocularly when writing to HTML files. Does anybody know what causes this? Does anyone have a solution to this?


(Assuming these are UTF-8 files). In UTF-8 a character can take upto 6 bytes. If the insertion of text using pos= is targeted in the middle of a multi-byte character, the rest of the document will be garbage.

If the position you are targetting contains a byte starting with 10, you are in the middle of a char.

0

精彩评论

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