CodeIgniter Forums
looking for the Ñ - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: looking for the Ñ (/showthread.php?tid=6627)

Pages: 1 2


looking for the Ñ - El Forum - 03-07-2008

[eluser]alebenson[/eluser]
hi there!.. problems again

if i set a charset=utf-8 i have the same problem of the first entry
so, ive change it to charset=iso-8859-1
and that was ok, but i was trying everything with strings of the db, that i have enter when i was with the utf-8

today i try enter something with ñ, like 'Feliz Año Nuevo', and when i checked for it and was 'Feliz A'
so the first thing i did was changing it to utf-8 back again, and that problem was solve

so,
if i have the charset in utf-8 i cannot find the Ñ
if i have the charset in iso-8859-1 probably CI wont let me put the whole Title in to the DB


looking for the Ñ - El Forum - 03-07-2008

[eluser]xwero[/eluser]
If you are using Pygons solution where you repalce the character with the html entity you need to do this during adding and updating too.

Which charset are you using for your database?


looking for the Ñ - El Forum - 03-07-2008

[eluser]alebenson[/eluser]
Hey
The db charset its wierdone, that my provider dont let me change, dont know why, but i dont have problems saving any character

well im trying to add a thing to the validation process and there change the 'ñ' to ñi did a MY_validation library

Code:
function latinchar($str)
{
    $str = str_replace('ñ','ñ',$str);
    return $str;
}

and it works, but when i see the HTML code looks like <p>Feliz Año Nuevo</p>
(i know it works coz ive try it with other letters)
so the replace is not taking the & n t i l d e ; as characters, is taking it as a code for ñ, again, im with the f****** ñ


looking for the Ñ - El Forum - 03-07-2008

[eluser]xwero[/eluser]
you should use the chr function like Pygon suggested it's more correct because if you hard code it because of the charset of the file it's possible it is transformed into another letter.


looking for the Ñ - El Forum - 03-07-2008

[eluser]alebenson[/eluser]
i dont think i understand
actualy, the str_replace() now CAN find de 'ñ' i dont need chr(241) anymore in the first parameter.
but now the problem is in the seccond one that is not taking it as i want, is taking it as what the code represents