Jump to content

PEAR - QuickForm - Charsets


spoldman

Recommended Posts

My script behaves very unusual. I have created a function to change Icelandic language characters to HTML encoding characters and it works normal on all the things I throw at it, except when I put PEAR->QuickForm->exportValues() data to it. Then it dosn't find the characters. And when i put them into my DB even stranger things happen.

 

Input to form => Á,

Data on webpage =>Á,

Data in DB => Ã

 

which isn't right it is suposed to be Á both on the web page and in the DB.

 

I think this has something to do whit charsets but I have been trying for over 7 ours just to fix this and have tried to search the web but I can't find anything about what this could be.

 

The function wich replaces Icelandic characters with HTML characters

 

function replace_isl($text){

   $letters = array('Á','á','Æ','æ','Ð','ð','É','é','Í','í','Ó','ó','Ö','ö','Ú','ú','Ý','ý');
   
   $asic = array('Á','á','Æ','æ','Ð','ð','É','é','Í','í',
                       'Ó','ó','Ö','ö','Ú','ú','Ý','ý');
       
   $output  = str_replace($letters, $asic, $text);
       
   echo substr_count($text,'æ');
   return $output;
       
}

 

here is the part of the sctript where I use this function

   $data = $form->exportValues();

   $foo= $data['name'];
   $foo = replace_isl($foo);
   echo $foo; //returns Á not Á as it should

 

Best regards

Baldur Árnason

Iceland

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.