Project

General

Profile

character encoding problem during importing repository changeset

Added by Thomas Wheeler over 14 years ago

I'm getting the following while attempting to import the changes for a repository:

Mysql::Error: Incorrect string value: '\x92s Gui...' for column 'comments'

It seems the comment is not in utf8, which is what MySQL is expecting. Can I get this comment (and potentially any others) into utf8 format prior to the insert into MySQL? Note I'm using Ruby 1.8 which apparently has little/no i18n support.

Suggestions welcome....

Thanks,
Thomas


Replies (1)

RE: character encoding problem during importing repository changeset - Added by Thomas Wheeler over 14 years ago

Just in case anyone else searches for this problem, here's a crude workaround. In cvs_adapter.rb, around line 179 (just before the "yield Revision.new") insert the following:

commit_log = commit_log.gsub("\x92s", "'")

Obviously this works only for the 0x92 character; if your repository commit messages are replete with other unfriendly characters you'll either be adding additional gsub's or looking for a better way.

Also I'm using Ruby 1.8 and I understand 1.9 has been support for i18n/encoding. That might be the "better way".

Thomas

    (1-1/1)