Hello

Am Sun, 4 Jan 2009 20:28:13 +0100
schrieb "Hannes Magnusson" <hannes.magnus...@gmail.com>:

> On Sun, Jan 4, 2009 at 19:53, Christian Hammers <c...@lathspell.de>
> wrote:
> > Hello
> >
> > I've incorporated all your suggestions and added a .cvsignore as
> > well as some "choice=opt" markers to the optional function
> > parameters.
> >
> > The new diffs are attached.
> 
> @ in examples is a big no no.

You mean suppressing error messages is bad style? The context here was:

// Cannot convert a domain name to ASCII that contains non-ASCII chars
// but already starts with "xn--"
$ascii = @idn_to_ascii("xn--".chr(0xC3).chr(0xA4), $errorcode);
if ($ascii === false) {
    printf("Detected error %d: %s\n", $errorcode,idn_strerror($errorcode));
}

The problem was that idn_to_ascii() prints E_USER_WARNING messages if
errors occur. I found not other way to check the outcome of this
function without any nasty stderr output except for temporarily
disabling error reporting and passing the optional $errorcode variable.
(I'd love to have exceptions here but the current implementation exists
since four years, just not properly documented yet)

> + <function name='idn_strerror' from='PHP 5 &gt;= 5.2.0'/>
> This ext is in PECL, not bundled with PHP5.2.0.

OK, fixed:

diff -u en/reference/idn/versions.xml en/reference/idn/versions.xml
--- en/reference/idn/versions.xml       2008-12-05 03:34:10.000000000 +0100
+++ en/reference/idn/versions.xml       2008-12-05 03:34:10.000000000 +0100
@@ -5,9 +5,9 @@
 -->
 <versions>
  <!-- Functions -->
- <function name='idn_strerror' from='PHP 5 &gt;= 5.2.0'/>
- <function name='idn_to_ascii' from='PHP 5 &gt;= 5.2.0'/>
- <function name='idn_to_utf8' from='PHP 5 &gt;= 5.2.0'/>
+ <function name='idn_strerror' from='PECL idn &gt;= 0.2'/>
+ <function name='idn_to_ascii' from='PECL idn &gt;= 0.1'/>
+ <function name='idn_to_utf8' from='PECL idn &gt;= 0.1'/>
  <!-- Methods -->
 </versions>
 

bye,

-christian-

Reply via email to