From: Richard C. <ri...@cy...> - 2006-03-01 15:51:50
|
Hi Shadi, On 1 Mar 2006, at 11:25, Shadi Abou-Zahra wrote: > Hi, > > Does RAP support non-ASCII characters in XML literals and if so, how? Yes, RAP can do that. But, as always, getting anything beyond US-=20 ASCII to work can be a serious pain. It's all a question of getting the character encoding right. By =20 default, RAP assumes all data to be UTF-8 encoded. If your data is =20 not UTF-8 encoded, then you either have to convert it to UTF-8 =20 (recommended) or set DEFAULT_ENCODING in constants.php to the =20 encoding of your data (For the cyrillic alphabet, try "iso-8859-5" or =20= "windows-1251"). Make sure that all your XML files start with an xml declaration (e.g. =20= "<?xml version=3D"1.0" encoding=3D"UTF-8"?>", or whatever encoding = you're =20 using instead of UTF-8). RAP-generated XML files will have this =20 automatically. If you output HTML, make sure it has this inside the <title> element: <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"> (or whatever encoding you're using instead of UTF-8). I'm not sure if =20= all RAP-generated HTML has this. RAP can't convert between different encodings, and can't combine RDF =20 input from different encodings. That's why I always recommend doing =20 everything in UTF-8. Most other encodings lack some characters that =20 some people will need. If this doesn't help, could you please provide a more complete =20 example of what you're doing and where it doesn't work. Yours, Richard > For example, to query and output the following information: > > > <dc:description rdf:parseType=3D"Literal"><span =20 > lang=3D"bg">=D0=91=D1=8A=D0=BB=D0=B3=D0=B0=D1=80=D1=81=D0=BA=D0=B8</span= > (Bulgarian)</dc:description> > > > Note: I've tried setting the "UNIC_RDF" constant to FALSE (in api/=20 > constants.php) but that did not help. This is what is returned: > > > <span lang=3D\\"bg\\">\u00D0\u0091\u00D1\u008A\u00D0\u00BB\u00D0\u00B3=20= > \u00D0\u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8</span> =20= > (Bulgarian) > > > Thanks, > Shadi > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642= > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |