0
I wonder how I can make to use special characters like ", when I insert one of these in my database it changes to "?"
Any hints on how I can do this ? I have no idea about it
0
I wonder how I can make to use special characters like ", when I insert one of these in my database it changes to "?"
Any hints on how I can do this ? I have no idea about it
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
It seems that the database ta converting them automatic to "?" am using var dump and they are being sent right to the database
– Lucas C.S
What encoding are you using in your database? Try using mysql_real_escape_string() to give the "Encode" in the string and then insert it into the database;
– Rafael Withoeft
utf8 general ci
– Lucas C.S
See if this helps you: http://stackoverflow.com/questions/2122866/how-to-insert-special-character-in-mysql-via-php-and-display-on-html-page
– Rafael Withoeft
Are you sure the comic is converting to
?
? Did you try to retrieve these characters from the BD, send them to the customer and try to display them? If you consult the BD via a console or other tool whose fountain do not support the inserted characters, it will display them as?
- although it keeps storing the correct value.– mgibsonbr
Yes this converting
– Lucas C.S
When I send one of these ate this error appears in phpmyadmin Warning: #1366 Incorrect string value: 'xE2 x9C x9F' for column 'task' at Row 1
– Lucas C.S
@Rafaelwithoeft These as ™ work normal
– Lucas C.S
Strange just tested here and worked smoothly with its characters. Already checked the result of the sql string before having it run?
– Rafael Withoeft
I’m using wamp I’ll test it on the server
– Lucas C.S
Even so it didn’t work, now I even tested by inserting directly into phpmyadmin and changed to "?"
– Lucas C.S
Try changing the specific field for utf-8 collation
– Rafael Withoeft
If I put them in my html they appear then my support source for them...
– Lucas C.S
@Rafaelwithoeft changed the default field to utf8_general_ci and it worked... now I don’t understand the reason why
– Lucas C.S
Well... also do not know the reason just analyzing better even to try to find out, but at least solved then; Put the solution as answer...
– Rafael Withoeft
This was probably because the encoding of the PHP and database files was different (iso/latin1 and utf8). http://rubsphp.blogspot.com.br/2011/07/problemas-com-charset-nunca-mais.html
– Lucas
To use these characters you must use utf-8, see this should help you: http://answall.com/a/43205/3635
– Guilherme Nascimento