Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strange chars

0 views
Skip to first unread message

Such Skywalker

unread,
Feb 13, 2006, 12:22:55 PM2/13/06
to
Hi, when I'm readig a text, sometimes words with accents (like the
spanish word "está") appear in a wrong way (está = está).

I don't know what I should do to correct this problem. Anybody nows?

Thanks & sorry 4 my english.

Steve Belanger

unread,
Feb 13, 2006, 12:41:03 PM2/13/06
to
Just a hunch here, but i would point that at the character set that does not
understand that specific character and use the closest match it can find in
the rendering.


"Such Skywalker" <alejand...@gmail.com> wrote in message
news:1139851375.2...@g44g2000cwa.googlegroups.com...

Dasdan

unread,
Feb 13, 2006, 12:48:46 PM2/13/06
to
> Hi, when I'm readig a text, sometimes words with accents (like the
> spanish word "está") appear in a wrong way (está = estĂĄ).

>
> I don't know what I should do to correct this problem. Anybody nows?
>
> Thanks & sorry 4 my english.

you should convert all special chars to htmlentities:

http://www.w3schools.com/tags/ref_entities.asp

you can do this in php with :
http://www.php.net/manual/en/function.htmlentities.php

Kind regards,

Kevin Wood
www.dasdan.be

--
http://www.dasdan.be


Such Skywalker

unread,
Feb 13, 2006, 6:19:26 PM2/13/06
to
I think the problem must be in other place because it does the same
thing when I use the htmlentities() function. That function translates
ó into &Atilde;&sup3; and I want to translate it into ó.

I'll tell you what I am doing:

I'm doing an RSS reader for my homepage using the simpleXML class. The
core function is this one:

$news = simplexml_load_file($url);

if($url){
$site = "".$noticias->channel->title;
$i = 0;
foreach ($news->item as $new) {
$mystring[$sie][$i]["title"] = "".$new->title;
$mystring[$site][$i]["link"] = "".$new->link;
if(isset($new->description)){
$mystring[$new][$i]["desc"] = "".$new->description;
}
$i++;
$this->items++;
}

Well, when I get $new->title, the string has that strange characters
(example: "¿Bloquea Telefónica los envíos SMTP? ¿Es legal
hacerlo?"), and I don't know how to correct them. I've thought about
using regular expressions. ¿Any other simpler ideas?.

You can see a very earlier version of my RSS reader on
http://raquiov.is-a-geek.org/modulos/rssReader.php
If the page doesn't appear, that's because I´m sleeping (the server is
in my bedroom).

Jasen Betts

unread,
Feb 13, 2006, 5:38:40 PM2/13/06
to
On 2006-02-13, Such Skywalker <alejand...@gmail.com> wrote:

> Hi, when I'm readig a text, sometimes words with accents (like the
> spanish word "está") appear in a wrong way (está = está).

char se.

> está
ISO-8859-1

>está
UTF-8


Bye.
Jasen

Such Skywalker

unread,
Feb 13, 2006, 9:27:19 PM2/13/06
to
It really was because of the encoding. I've used this function

mb_convert_encoding($string, "ISO-8859-1", "auto");

and now it works.

Thanks 4 all.

Sergey Groshev

unread,
Feb 14, 2006, 12:59:33 AM2/14/06
to

Hello, Such.


You need to specify correct html charset and set correct value for default_charset variable in php.ini

-- 

Regards

 Sergey                          mailto:e21...@motorola.com

0 new messages