I had the same problem with Greek but I used Sablotron with PHP for Windows, so I 
didn't want to recompile Sablotron or get libiconv. The solution to the problem is to 
convert your text to UTF-8. The only difficulty is that PHP only encodes ISO-8859-1 to 
UTF-8, which means that you have to do the conversion on your own. So I found an 
article in PHPBuilder's forum about UTF-8 encoding problem. Two brilliant guys have 
written a function that encodes text from any character set to UTF-8. This function as 
is works for converting text from cp1250 to UTF-8. The only thing you have to do is go 
to www.unicode.org and download character mappings from your character set to Unicode 
and replace the ones in the function for yours. So you get a function like PHP's 
utf8_encode() except that it works for your character set. I 'm sorry but I can't post 
the address of the article right now, because apparently the PHP's forum index was 
being updated at the time but I'm sure you'll find it.
------ Original Message ------

Hi,

I would appreciate advise on the following :

I need to output Hebrew content using Sablotron.

Sablotron Version : Sablotron 0.52
Operating System : Linux Redhat 7.0
Kernel : 2.2.16-22 
glibc-2.1.92
iconv (GNU libc) 2.1.92


            In version 0.52, the encoding conversion capabilities of
Sablotron have
            been much extended. The most important fact is the
following: if you have
            the iconv library installed on your system, you can use any
encoding it
            supports (that is, almost any encoding whatsoever) for both
the input and
            the output documents. Iconv is available on most systems (it
is a standard
            part of glibc2, for instance). There are implementations for
Win32 as well. 

            If iconv is not available, the encoding may still be
supported internally by
            Sablotron. At present, the list is of such encodings is
rather short: besides
            UTF-8, these are UTF-16, ASCII, iso-8859-1, iso-8859-2 and
            windows-1250 on input, none on output. However, we plan to
implement a
            half independent light-weight conversion library for use on
systems without
            iconv, extending the set of internally supported encodings
considerably. 

            Lastly, the user has the option to implement a custom
encoding conversion
            handler, which will be asked to perform any unsupported
conversion. See
            the shandler.h header file for details. 

            The default input and output encoding is in all cases UTF-8.

Sample xml :

------------------------------- 
<?xml xml version="1.0" encoding="iso-8859-8"?>
 <root>
    <text>
        �������� ���������
  </text>
 </root>
-------------------------------

Sample xsl :

-----------------------------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="html"/>
<xsl:template match="root">

<html>

<head>
<title>Welcome to Israel</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-8"/>
</head>

<body>

<h2><xsl:value-of select="text"/></h2>
<h2>a����� ����� ������</h2>
</body>
</html>

</xsl:template>
</xsl:stylesheet>

--------------------------------------------------------------------------

Error : 
sabcmd hebrew.xml hebrew.xsl 
Error [code:2] [URI:file:/tmp/hebrew/hebrew.xsl] [line:16] 
  XML parser error 4: not well-formed (invalid token)

How would I impliment this encoding set iso-8859-8 successfully xml
input and xsl output ?
How would I impliment the iconv library ?
Development language is php4. should I need to develop a wrapper so be
it ..

Advise exteemly appreciated .

Regards
George

Reply via email to