transform text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alain dhaene

    transform text

    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

    #2
    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.


    Comment

    • Tony Marston

      #3
      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

      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL



      "alain dhaene" <a.dhaene@instr uct.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]


      Comment

      • Chung Leong

        #4
        Re: transform text

        "alain dhaene" <a.dhaene@instr uct.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.


        Comment

        Working...