Connecting Tech Pros Worldwide Forums | Help | Site Map

transform text

alain dhaene
Guest
 
Posts: n/a
#1: Jul 17 '05
HI,

I retrieve data from a text box. I store this in a mysql db and later I
retrieve the data and make a xml-format.

This works but when I put characters such as é I have problems to make the
xml-format.

Is there a way to transform the text from the text box in a ascii format and
then store this in the db?

thx,

Alain



Berislav Lopac
Guest
 
Posts: n/a
#2: Jul 17 '05

re: transform text


alain dhaene wrote:[color=blue]
> HI,
>
> I retrieve data from a text box. I store this in a mysql db and later
> I retrieve the data and make a xml-format.
>
> This works but when I put characters such as é I have problems to
> make the xml-format.
>
> Is there a way to transform the text from the text box in a ascii
> format and then store this in the db?[/color]

You need to specify the encoding in the XML file.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.


Tony Marston
Guest
 
Posts: n/a
#3: Jul 17 '05

re: transform text


If you are using PHP's XML DOM functions to create your XML data then take a
look at http://www.tonymarston.co.uk/php-mys...tml#multi-byte which
explains how to deal with multi-byte character sets.

--
Tony Marston

http://www.tonymarston.net


"alain dhaene" <a.dhaene@instruct.be> wrote in message
news:4088e454$0$10826$a0ced6e1@news.skynet.be...[color=blue]
> HI,
>
> I retrieve data from a text box. I store this in a mysql db and later I
> retrieve the data and make a xml-format.
>
> This works but when I put characters such as é I have problems to make[/color]
the[color=blue]
> xml-format.
>
> Is there a way to transform the text from the text box in a ascii format[/color]
and[color=blue]
> then store this in the db?
>
> thx,
>
> Alain
>
>[/color]


Chung Leong
Guest
 
Posts: n/a
#4: Jul 17 '05

re: transform text


"alain dhaene" <a.dhaene@instruct.be> wrote in message
news:4088e454$0$10826$a0ced6e1@news.skynet.be...[color=blue]
> HI,
>
> I retrieve data from a text box. I store this in a mysql db and later I
> retrieve the data and make a xml-format.
>
> This works but when I put characters such as é I have problems to make[/color]
the[color=blue]
> xml-format.
>
> Is there a way to transform the text from the text box in a ascii format[/color]
and[color=blue]
> then store this in the db?[/color]

UTF-8 is the preferred method of encoding character data in XML. Pass the
text through utf8_encode() before you place it into the XML file.


Closed Thread