Tom Bak wrote: > I have problem with legacy database in MSSQL encoding. > > The new app in Rails and most of the database is Utf8, while > tables from legacy MSSQL are encoded in ISO-8859-1. > > I am not sure how to approach this problem. I would imagine > creation of some kind of filter with Iconv.conv("UTF-8", "ISO-8859-1", > input) > for reading sql statements and the reverse for write methods. > > Any suggestions how this could be done?
I think that everyone who's ever been cornered by this can attest that it can be a royal pain and that the options are all choosing between lesser evils. Last time I found myself there I exported the database to a plain text SQL file and then ran recode [1] on it. It worked well enough but I still found myself scanning over the file to correct tiny bits here and there. I'll admit that your solution has a ring to it -- being able to do it on the fly improves the time to deploy. I like it. If however speed or strict migration paths are an issue for you then recode may be an option to consider. [1] http://www.gnu.org/software/recode/ -- Roderick van Domburg http://www.nedforce.nl -- Posted via http://www.ruby-forum.com/. _______________________________________________ Railsi18n-discussion mailing list Railsi18n-discussion@rubyforge.org http://rubyforge.org/mailman/listinfo/railsi18n-discussion