Jump to content

Character encoding issue


Jabop

Recommended Posts

Hi guys, long time no see. :P

 

I have a form, with a radio field:

<input type="radio" name="radio_name" value="Oui, j&#8217;aimerais avoir site en français." />

 

However, when the form is posted, the value submitted is:

Oui, j’aimerais avoir site en français.

 

In turn, prohibits me from comparing the values for validation. I've tried messing with htmlspecialchars/entities, to no avail. How can I preserve the exact value when posting, or, compare them with the "output" value of the characters?

 

Hopefully this description is not too vague. Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/137424-character-encoding-issue/
Share on other sites

<?php
echo htmlentities('Oui, j’aimerais avoir site en français.',ENT_QUOTES,'UTF-8');
?>

 

That returns Oui, j’aimerais avoir site en français.

 

I suppose my database value had a different or not standard value for ’

 

I can change that. Fixed, thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.