php-windows Digest 27 Jun 2011 16:33:58 -0000 Issue 3961

Topics (messages 30673 through 30674):

Re: STDOUT and STDERR with php.exe and php-win.exe on Win XP
        30673 by: Richard Quadling

The Table Of Contents for Windows CHM files.
        30674 by: Richard Quadling

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 20 June 2011 23:27, JDS <j...@forerunnertv.com> wrote:
> On 6/20/2011 11:27 AM, Richard Quadling wrote:
>>
>> On 20 June 2011 18:18, JDS<j...@forerunnertv.com>  wrote:
>>>
>>> I am trying to figure out how this all works on Win XP...
>>>
>>> When I call php.exe or php-win.exe from another script (AutoHotKey in my
>>> case), do both of these programs use stdout and stderr? I know php.exe
>>> has a
>>> console window and php-win.exe does not, but just need to know how they
>>> output the results.
>>>
>>> Thanks
>>
>> STDOUT is the normal output for php.exe.
>>
>> To write to the STDERR, you can ...
>>
>> php -r "file_put_contents('php://STDERR', 'This is an error');">
>> PHP_STDOUT.txt 2>  PHP_STDERR.txt
>>
>> 2011-06-20  17:26                16 PHP_STDERR.txt
>> 2011-06-20  17:26                 0 PHP_STDOUT.txt
>>
>> OOI. If you want to use PHP scripts to act as a filter. E.g.
>>
>> command | php script, then read
>> http://docs.php.net/manual/en/install.windows.commandline.php
>>
> What about php-win.exe? Does it write to STDOUT as well even though there is
> no console window?
>
> Thanks

Running ...

php-win -r "echo file_put_contents('php://STDERR', 'This is an error');"

outputs nothing.

Same command with outputs redirected ...

php-win -r "echo file_put_contents('php://STDERR', 'This is an
error');"  > STDOUT.txt 2>STDERR.txt

outputs the 2 text files - the content of STDOUT.txt is 16.

So, you can capture STDOUT and STDERR and NOT have a console box.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--- End Message ---
--- Begin Message ---
Hello all.

The Windows CHM files are built weekly and all output from the various
processes are logged accordingly.

When building the fa and ro translations, there are some issues with
the code that generates the table of contents for the CHM file.

In essence the UTF-8 text being incorporated into the TOC has to be
translated to a particular codepage (Windows-1254 for fa and
Windows-1250 for ro).

Unfortunately, these codepages don't contain all the symbols required
for the original text and a log entry is created saying ...

"[08:45:59 - E_NOTICE              ]
C:\pear\phd-trunk\phpdotnet\phd\Package\PHP\CHM.php:263
        iconv(): Detected an illegal character in input string".

This is as expected based upon
http://docs.php.net/manual/en/function.iconv.php (out_charset
parameter) ...

"The output charset.

If you append the string //TRANSLIT to out_charset transliteration is
activated. This means that when a character can't be represented in
the target charset, it can be approximated through one or several
similarly looking characters. If you append the string //IGNORE,
characters that cannot be represented in the target charset are
silently discarded. Otherwise, str is cut from the first illegal
character and an E_NOTICE is generated."


I think the codepage for fa is wrong (based upon
http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx) and that it
should be Windows-1256 - it made no difference to the output in terms
of notices.




Is there a more appropriate codepage to be used? (I don't think so)

Should we be using //TRANSLIT//IGNORE? (I don't think so but may have to),

Or, for these 2 languages, should we use the English data (purely for
the CHM TOC, Search and index tabs).

If you have a native language CHM file for any purpose where the TOC
correctly shows your native language, then I could see how this has
been put together and make appropriate corrections (if possible).

As things stand though, it looks like the Windows CHM viewer has
certain limitations to the codepages it will support as part of the
TOC, search and index.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--- End Message ---

Reply via email to