Link to home
Start Free TrialLog in
Avatar of DrXoulian
DrXoulian

asked on

UTF 8 character search issue.

I am using php to search for a given string from internet. I search for '°'. And it gives me nothing. I have set utf 8 in php and mysql. Whats wrong?
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DrXoulian
DrXoulian

ASKER

Visit http://www.jahkenkenrecords.com/labels03.php?id=8377
You will see some ° there. Try to search for them. It returns nothing.
Why?
BuiltWith recognises an HTML5 document, generated by PHP in UTF-8 encoding.
https://builtwith.com/?http%3a%2f%2fwww.jahkenkenrecords.com%2flabels03.php%3fid%3d8377

It looks like what you want is the "degree" character.  There is a character entity that I would use for this.  It's °

The A-circumflex you're seeing is a UTF-8 character prefix for the degree character, when the degree is used explicitly, and not presented in the character entity.  The degree character looks like this, in ASCII:  °

This is all explained in the article about Unicode.

This line appears to have the wrong information:
<div class="jkrtable-cell"><a class="link-release" href="releases03.php?id=6590421">96° In The Shade</a></div>

Open in new window

And this line appears to have it right, so I would use whatever is generating this line and follow that guidance for the other lines.
<div class="jkrtable-cell"><a class="link-release" href="releases03.php?id=2422814">96º In The Shade / Prisoner In The Street</a></div>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David Favor
Character set oddities can be challenging to figure out.

Best to step through each layer of your code logically.

Start with your storage engine + charset for fields, depending on how you've setup your Schema.

Then debug your page by pulling your page content with curl + verify returned content is correct outside a browser environment.

Then check inside your browser.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
abandoned question, accepting the working answers