-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
nonASCII punctuation characters can not display in python363.chm. #76355
Comments
In chm(python363.chm) documents, some unicode chars (non ascii chars) can not display. asyncio — Asynchronous I/O, event loop, coroutines and tasks displayed as asyncio � Asynchronous I/O, event loop, coroutines and tasks and Asynchronous programming is more complex than classical “sequential” programming display as Asynchronous programming is more complex than classical 搒equential� programming windows 10, simplified chinese language. |
I'm not sure there will be any good fix for this. We might be able to coerce proper utf-8 output from Sphinx, and if it also adds the encoding tags required by whatever ancient version of Internet Explorer is used then it should be fine It's likely just best to avoid special punctuation in doc source files though. |
The doc source files do not contain smart quotes, and as far as I know, sphinx does produce correct utf-8. Recently there was a bug where incorrect smart quotes were leaking out of the internationalization of the docs, so this might be a problem that is already fixed. On the other hand, there might be something broken about the chm production process. I have no idea who would be the right person to investigate that, since I think Steve just spins the wheel on existing tools to get them generated :) On the gripping hand, could there be something broken about your local charset configuration? Does anyone else see this problem? |
I found the problem was not fixed on python364.chm but it show well on python362.chm, maybe the python.org official config was a change to let the coding error. |
Here is a solution:
|
The source code of .chm changed between 3.6.2 and 3.6.3, the former uses escaped html entities. 3.6.2 chm: <h1>What&bpo-8217;s New In Python 3.6</h1> 3.6.2 chm: <h2>Summary &bpo-8211; Release highlights</h2> Release date: |
We should probably prefer to force ASCII with explicit escapes (ideally named escapes, rather than codepoints). I'm not sure how to make Sphinx/docutils do that, but presumably it could be our own extension that handles the problematic characters people add to our docs. |
In python365.chm, it loss the style in any page but can show in IE. |
And in python365.chm, also had some non ascii chars can not display. |
This issue still persists in 3.6 and 3.7. |
Until someone creates and enables a Sphinx extension/option to only generate ASCII output, it will remain. Volunteers are welcome |
I will create a PR to fix this within a day. |
It seems impossible to specify the encoding of .chm to ASCII [1], the available encodings of .chm are limited to a list [2]. So I wrote a Sphinx extension for .chm output, it escapes the characters which (codepoint > 0x7F) to 7-bit ASCII. Most escaped characters are: “”’–…— [1] https://github.com/sphinx-doc/sphinx/blob/master/sphinx/builders/htmlhelp.py#L203-L206 |
Thanks, that looks perfect! |
It seems to me that this adds escape4chm as unconditional dependency on all platforms. Which seems like a bad idea to me, I don't think users on Linux or Mac OS X are that keen on *.chm files. I think this change broke my build of python3-doc package on openSUSE (which built until now absolutely perfectly). I don't even know, where the escape4chm plugin comes from. ??? |
What version of Python are you running Sphinx with? Your error is that |
BTW, the related navigation bar still has corrputed characters, see the attached file. This can't be fix via Sphinx extension. |
Sorry, my mistake, it seems I was using python2 Sphinx even for building python3 documentation, which is a bad idea, I guess. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: