开发者

Chinese writing when writing to 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜