Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhD generates garbled chm on PHP 5.4.0 or later. #3

Merged
merged 1 commit into from
Dec 29, 2013
Merged

PhD generates garbled chm on PHP 5.4.0 or later. #3

merged 1 commit into from
Dec 29, 2013

Conversation

mumumu
Copy link
Member

@mumumu mumumu commented Jun 27, 2013

Description

PhD generates garbled chm on PHP 5.4.0 or later, because of htmlspecialchars spec change (newly supports some encodings, CP932 and the default value for the encoding parameter was changed to UTF-8).
http://php.net/manual/en/function.htmlspecialchars.php

This issue cannot be reproduced on PHP 5.3.x.

How reproducible

Always on PHP 5.4.x, PHP 5.5.0

How to reproduce

  1. install PHP and the latest PhD (1.1.6 or git version)
  2. svn co http://svn.php.net/repository/phpdoc/modules/doc-ja
  3. php doc-base/configure.php --with-lang=ja --enable-xml-details --disable-libxml-check
  4. phd -f chm -P PHP -L ja -d doc-base/.manual.xml

Expected result

In the following files, the valeu of "name (<param name="Name" value="...">) is not empty. not garbled.

output/php-chm/php_manual_ja.hhc
output/php-chm/php_manual_ja.hhk

Actual Result

In the following files, the valeu of "name (<param name="Name" value="...">) is empty.
this is because htmlspecialchars function's return value is empty by specifying default encoding.

output/php-chm/php_manual_ja.hhc
output/php-chm/php_manual_ja.hhk

Suggesting fix

Pull request's source.
We should specify htmlspecialchars third parameter (encoding) with preferred_charset.

Extended Notes

This fix emits E_NOTICE in some locale on PHP 5.3.x, because 'CP932' and some encodings are not supported on htmlspecialchars on PHP 5.3.x. But this is not affected because PHP 5.3.x fallback to ISO-8859-1.

bjori added a commit that referenced this pull request Dec 29, 2013
PhD generates garbled chm on PHP 5.4.0 or later.

* mumumu/fix_garbled_chm_on_php5_4_0_or_later:
  - fixed bug PhD generates garbled chm on PHP 5.4.0 or later.
@php-pulls php-pulls merged commit ba9ccd6 into php:master Dec 29, 2013
@bjori
Copy link
Member

bjori commented Dec 29, 2013

I'm so sorry, I never saw this PR!
Merged now, thanks!

@mumumu mumumu deleted the fix_garbled_chm_on_php5_4_0_or_later branch December 17, 2019 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants