I've not analyzed "Convert db2utf8" to see if it:
- Just uses DB_CHARSET and database table storage format.
- Uses DB_CHARSET, the database table storage format, and runs queries per language (converting row by row based upon the language's CHARSET).
If it does the first - you may run into problems if your original data used two different CHARSETs (it sounds like yours did). If the script does the second - things probably will be just fine. Quickest way to check is after running the script set both languages to use CHARSET UTF8 and DB_CHARSET UTF8 and see what happens :)
What does this mean?
Take the following example of the issues (imperfect, very basic, but hopefully helpful)...
Starting with the current state of things with multiple file types (language CHARSETs), one communication format (DB_CHARSET), and one storage type (database table encoding).
- Take a zip file, send it to a server (communicating using gzip), and store the file into a zip file.
- Take a rar file, send it to a server (communicating using gzip), and store the file into a zip file.
Now if we run a script which only knows to talk to the server using gzip and the server stores the file into a zip file... And then tell the server to change the storage from a zip file to a gzip file... And at the same time says "convert the data from zip to gzip"....
Case 1 above will turn out just fine as the data (zip) and the underlying storage (zip) were the same. However Case 2 will take the data (rar) and convert using (zip -> gzip) as it does not know the original data is a rar file (and assumes it is the same as the way the data is stored on the server). This will probably result in corrupted data.
Now if the script also knows there are multiple types of original files (zip and rar)... The script can then start by selectively pulling all the rows with rar files and converting them to zip files. Afterwards the bulk conversion from zip to gzip will work just fine for both Case 1 and Case 2.



Reply With Quote
