# Help on PHP,SQL special char encoding

**URL:** https://forum.kirupa.com/t/help-on-php-sql-special-char-encoding/296776
**Category:** programming
**Created:** [September 20, 2009, 10:20am UTC](https://forum.kirupa.com/t/help-on-php-sql-special-char-encoding/296776 "2009-09-20T10:20:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![epoy08](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@epoy08](https://forum.kirupa.com/u/epoy08)
#### Post date: [September 20, 2009, 10:20am UTC](https://forum.kirupa.com/t/help-on-php-sql-special-char-encoding/296776/1 "2009-09-20T10:20:18Z")

</div>

I have a problem on displaying “ñ” when I used javascript(ajax) to send to my callback url I used

escape(str)

then the php callback file will save it to mySQL, the field data type is in VARCHAR, when I look into the phpMyAdmin, the value is okay, it is “ñ” but when I retrieve it and display it, it shows diamond symbol with a “?” on it.

do I have to use a code to return it to “ñ” ?  
I already used urlencode & urldecode. But it displays a more complicated value.

I have two displays. I retrieved the variable and display it on html/XML using ajax. And I also use the same variable displayed in a PDF file format. The PDF file displayed “ñ”, but the HTML/XML displays the strange “?” value.

Thanks for the help.
