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.
精彩评论