Character encoding changes as I enter search string
Character encoding changes as I enter search string
I've got a real strange issue here. After fighting for hours on getting UTF-8 encoding set up properly in my OS, web server, Perl scripts, PHP pages and mysql tables I've got my data with unicode characters displaying and being manipulated correctly. Some of the time. Most of the time when I enter a search string, everything works as expected. Sometimes, when I enter the string, I just get ?????'s back. Sometimes, the results being displayed will switch right in front of my eyes from the correct character set to ?????'s. I'm completely baffled as to what could cause this type of behavior. Happy to provide whatever code might be helpful. Here's my basic data flow:
1 Linux find command finds UTF-8 encoded filenames and creates a .txt file
2 Perl script creates a table in mysql (using DBI) and populates it with contents of .txt file
3 PHP-enabled site uses DataTables to display contents and generates jquery .post action hyperlinks
4 Links POST filename content to PHP script that inserts it into another mysql table
5 The data is used from both tables in a variety of ways, assuming the encoding stays correct
I have watched the process work from start to finish. I've also seen the display break down in step 3. When it does, it passes the incorrectly encoded filenames to step 4.
Any thoughts would be appreciated!
1 Linux find command finds UTF-8 encoded filenames and creates a .txt file
2 Perl script creates a table in mysql (using DBI) and populates it with contents of .txt file
3 PHP-enabled site uses DataTables to display contents and generates jquery .post action hyperlinks
4 Links POST filename content to PHP script that inserts it into another mysql table
5 The data is used from both tables in a variety of ways, assuming the encoding stays correct
I have watched the process work from start to finish. I've also seen the display break down in step 3. When it does, it passes the incorrectly encoded filenames to step 4.
Any thoughts would be appreciated!
This discussion has been closed.
Replies
Visit http://armitunes.com
Top Menu "Radio Controls" -> "Request Song"
Search box: fire emblem
It'll either display correctly, or not correctly, or change halfway through. Case doesn't seem to matter. It also doesn't seem to matter whether you are matching against the "Album" column or the "Song" column (ie: if you specify 01 - fire emblem).
Working:
http://armitage.crinkle.net/misc/utf8_working.jpg
Not Working:
http://armitage.crinkle.net/misc/utf8_not_working.jpg