• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1216
  • Last Modified:

.php insert text in mysql / strange characters

Hi,

I would like to add text into mysql, but there is something fishy going on.
When i try to put this word into mysql: geïsoleerd

it changes into:  geïsoleerd

Note:
When submitted here, the values above change. The first word has an i with double dots.
The second has a capital A with an ~ on top and a High line.

Never had this problem before. Anyone knows what's going on?
0
dwax
Asked:
dwax
  • 3
1 Solution
 
dwaxAuthor Commented:

Hmm aparently the same issue appear here...
0
 
psimationCommented:
try using htmlspecialchars() function to "encode" your text BEFORE you write it to the DB, or at least before you echo it to screen in a browser.
0
 
dwaxAuthor Commented:

Thanks for your reply.
I did try htmlspecialchars(),   but it doesn't change it.

Never had this problem. This forum also suffers from this thing.
Any other ideas?
0
 
dwaxAuthor Commented:

Okay, found the solution :
$Text = htmlentities(utf8_decode($_POST['Text']));

That does the trick!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now