[PHP] Re: DOMXML and encodings (php4.1.2, libxml2.4.16)

2002-03-24 Thread Stefan Livieratos

Hi

Lucky wrote:
 Hello all, I have a little problem with encodings with libxml2 resp. domxml
 in php.
 
 In our site we're storing articles as XML, ISO-8859-1 encoded (indicated in
 xml-header). Libxml2 is doing all the internal processing in UTF-8, so the
 article gets translated to UTF-8. But when I do an xmltree() on the article,
 all output of libxml is in UTF-8, too, and it's really ugly to read german
 umlauts in UTF-8 in a browser displaying all as ISO-8859-1.
 Is there any way (other than manually do utf8_decode on every part of the
 output, which is _very_ ugly and annoying) to tell php or libxml to output
 things in UTF-8?

No, unfortunately there isn't. Here's a quote from the libxml site 
(http://xmlsoft.org/encoding.html):

... basically the I18N (internationalization) support get triggered 
only during I/O operation, i.e. when reading a document or saving one

Regards,
Stefan Livieratos


-- 

ICS Plus
Internet Consulting + Services
==
Aeussere Brucker Str. 51
D-91058 Erlangen
Germany
==
Tel: +49 9131 127733
Fax: +49 9131 127744
E-mail : [EMAIL PROTECTED]
Web: http://www.icsplus.de
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: HELP! Open HTTPS://, and follow rediect header

2002-03-24 Thread Stefan Livieratos

Hi,

Zlutarch G. wrote:
 Hi All,
 
 I need help on two problems:
 1) Is there a PHP function similar to fopen() that would open URL begins 
 with https://;, i.e., SSL address?
fopen(https://...;) is working with current CVS but is not going to be 
in a release before version 4.3. For now you can use the cURL module 
provided the cURL library is compiled with OpenSSL support.

 
 2) Does anyone know if it is possible in PHP to read redirect 
 instructions in HTTP header, and then follow the links?
Use the cURL module:
?php
$ch = curl_init (http://www.php.net/;);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_NOBODY, 1);
ob_start();
curl_exec ($ch);
$header = ob_get_contents();
ob_end_clean();
curl_close ($ch);
?
Now search for the Location header in $header.

Regards,
Stefan Livieratos

-- 

ICS Plus
Internet Consulting + Services
==
Aeussere Brucker Str. 51
D-91058 Erlangen
Germany
==
Tel: +49 9131 127733
Fax: +49 9131 127744
E-mail : [EMAIL PROTECTED]
Web: http://www.icsplus.de
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php