# Thai language

**URL:** https://forum.kirupa.com/t/thai-language/238090
**Category:** programming
**Created:** [September 7, 2007, 3:40am UTC](https://forum.kirupa.com/t/thai-language/238090 "2007-09-07T03:40:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rhamej](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rhamej](https://forum.kirupa.com/u/rhamej)
#### Post date: [September 7, 2007, 3:40am UTC](https://forum.kirupa.com/t/thai-language/238090/1 "2007-09-07T03:40:17Z")

</div>

[COLOR=Red]SOLVED[/COLOR] =)

I’ve never worked with a foreign language before, so I’m a little stuck.

I built a simple backend that uploads data to a mySQL db using php.  
The Thai language shows fine in the html textarea no problem.  
However, I’m using php to create an XML file to yank the data.

```php

<?php 
$db = mysql_connect("localhost","XXXX","XXXX") or die("couldn't connect: " . mysql_error());
mysql_select_db("XXXX",$db) or die("no db: " . mysql_error());
header("Content-type: text/xml");
$xml_output = "<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<gallery>
";
    $sql = "SELECT * FROM gallery ORDER BY ID DESC";
    $resultID = mysql_query($sql) or die (mysql_error());
    while ($row=mysql_fetch_assoc($resultID)) {
        $xml_output .= " <item>
";
        $xml_output .= " <description1>".str_replace("&nbsp;"," ",htmlentities($row['TITLE']))."</description1>
";
        $xml_output .= " <description2>".str_replace("&nbsp;"," ",htmlentities($row['COMMENTS']))."</description2>
";
        $xml_output .= " <link>".htmlentities($row['SRC'])."</link>
";
        $xml_output .= "	</item>
";
    }
    $xml_output .= "</gallery>
";
    echo $xml_output;

?>

```

The Thai characters are getting stored as unicode, like so: (with out the spaces, damn forum was converting it for me)

```auto

& #3650;& #3619;& #3591;& #3586;& #3634;& #3618;& #3618;& #3634;

```

The XML is writing it just like that and Flash is seeing it just like that.  
How do I get Flash/PHP to convert that to Thai?

Thanks,  
Josh
