The Windows Registry editor created Windows Unicode (UTF-16-le) files when you export a registry key. I am trying to figure out the best way to import those files into a mysql database using PHP so that they can later be downloaded as a unicode file again?
When I import them into the database I am using file_get_contents() and just storing them into the utf-8 column. When I export them, I first use mb_convert_encoding($row['reg'], 'UTF-16') and issue headers to have the file downloaded. When I open them in Windows, though, the content is just garbled.
Any thoughts on the proper way to handle this?
Thought I would share the solution that I was able to figure out. The trick was to use UTF-16LE as the original charset.