# Converting special characters outside the basic latin

**URL:** <https://forum.kirupa.com/t/converting-special-characters-outside-the-basic-latin/245421>\
**Category:** Uncategorized\
**Created:** [November 29, 2007, 4:07pm UTC](https://forum.kirupa.com/t/converting-special-characters-outside-the-basic-latin/245421 "2007-11-29T16:07:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaplanyo](https://avatars.discourse-cdn.com/v4/letter/k/35a633/32.png) [@kaplanyo](https://forum.kirupa.com/u/kaplanyo)\
**Post date:** [November 29, 2007, 4:07pm UTC](https://forum.kirupa.com/t/converting-special-characters-outside-the-basic-latin/245421/1 "2007-11-29T16:07:28Z")

</div>

I’m looking for some help on using get\_html\_translation\_table(). There’s a nice function on [php.net](http://php.net) for adding some of the special characters not included in the htmlentities(). Characters that might be pasted from Word or special Keystrokes (on my mac - like for a curly quote). How can I run this function with the php that sets up my xml. See code below. Any help would be much appreciated.

Here’s the function I would like to use on my xml.php output file.

```php
function get_html_translation_table_CP1252() {
    $trans = get_html_translation_table(HTML_ENTITIES);
    $trans[chr(130)] = '&sbquo;'; // Single Low-9 Quotation Mark
    $trans[chr(131)] = '&fnof;'; // Latin Small Letter F With Hook
    $trans[chr(132)] = '&bdquo;'; // Double Low-9 Quotation Mark
    $trans[chr(133)] = '&hellip;'; // Horizontal Ellipsis
    $trans[chr(134)] = '&dagger;'; // Dagger
    $trans[chr(135)] = '&Dagger;'; // Double Dagger
    $trans[chr(136)] = '&circ;'; // Modifier Letter Circumflex Accent
    $trans[chr(137)] = '&permil;'; // Per Mille Sign
    $trans[chr(138)] = '&Scaron;'; // Latin Capital Letter S With Caron
    $trans[chr(139)] = '&lsaquo;'; // Single Left-Pointing Angle Quotation Mark
    $trans[chr(140)] = '&OElig; '; // Latin Capital Ligature OE
    $trans[chr(145)] = '&lsquo;'; // Left Single Quotation Mark
    $trans[chr(146)] = '&rsquo;'; // Right Single Quotation Mark
    $trans[chr(147)] = '&ldquo;'; // Left Double Quotation Mark
    $trans[chr(148)] = '&rdquo;'; // Right Double Quotation Mark
    $trans[chr(149)] = '&bull;'; // Bullet
    $trans[chr(150)] = '&ndash;'; // En Dash
    $trans[chr(151)] = '&mdash;'; // Em Dash
    $trans[chr(152)] = '&tilde;'; // Small Tilde
    $trans[chr(153)] = '&trade;'; // Trade Mark Sign
    $trans[chr(154)] = '&scaron;'; // Latin Small Letter S With Caron
    $trans[chr(155)] = '&rsaquo;'; // Single Right-Pointing Angle Quotation Mark
    $trans[chr(156)] = '&oelig;'; // Latin Small Ligature OE
    $trans[chr(159)] = '&Yuml;'; // Latin Capital Letter Y With Diaeresis
    ksort($trans);
    return $trans;
}

```

And the php that outputs my xml:

```php
echo "<winesbyglass menu_name=\"WINES BY THE GLASS\">
";
while ($rowGlass = mysql_fetch_assoc($resultGlass)) {
// you need to use the htmlentities to get the accented characters in flash.
// unfortunately, curly quotes are outside the set of entities that can be converted.
echo "	<category category_name=\"".htmlentities($rowGlass['category'])."\">".htmlentities($rowGlass['menuitems'])."</category>
";}
mysql_free_result($resultGlass);
echo "</winesbyglass>
";

```
