This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script will switch all textual columns in your db to a new encoding | |
| # without switching the actual bytes in those columns. If you had a dumb | |
| # programming language like Ruby 1.8 that dumped a bunch of utf8-encoded | |
| # strings into your latin1 database columns, then switching to a better | |
| # programming language (like Ruby 1.9) may get you some weird results. MySQL | |
| # will try to be helpful, and convert the stored bytes from latin1 to utf8. But | |
| # since they're already in utf8, you get gobblidigook. | |
| # | |
| # Find more detail and a more complete description of the strategy used here at |