-
Notifications
You must be signed in to change notification settings - Fork 10
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
behave_html_formatter:HTMLFormatter: Unicode/UTF-8 issues #22
Comments
I've taken a quick peek into the code and saw that we're setting the character encoding via Could you verify what the resulting HTML looks like on the top? It should:
Personally, I prefer This issue might be related to #2. You might want to run HTML validation over your generated document. If you want to create a PR for appropriate fixes then, that would be very much appreciated! The output of |
Current HTML source ( generated 07/13/2021 ):
Issue like: Body: Forgatókönyv is translation of Scenario: Scenario Note: |
Interesting! I assume when you replace the meta tag by Hence, the generated content is probably not written in UTF-8. Related Code
@jenisys Do you know of any issues with character encoding in the Formatter class? |
Sorry, for the late reply. Unicode encoding causes different problems with different Python versions NOTES:
OTHERWISE: |
Thank you for reply We forced to use powershell, with PYTHONIOENCODING UTF-8 value, terminal output is fine but, only got issues in the saved HTML |
HTML formatter works fine for me with special non-ASCII characters (Sonderzeichen). I am using:
I run (using a feature-file w/ French language keywords, using accents, etc.): $ behave -f html -o behave.html -f pretty tools/test-features/french.feature
Fonctionnalité: testing stuff # tools/test-features/french.feature:2
Scénario: test stuff # tools/test-features/french.feature:4
Etant donné I am testing stuff # tools/test-features/steps/steps.py:11 0.000s
Quand I exercise it work # tools/test-features/steps/steps.py:24 0.000s
Alors it will work # tools/test-features/steps/steps.py:29 0.000s
Scénario: test more stuff # tools/test-features/french.feature:9
Etant donné I am testing stuff # tools/test-features/steps/steps.py:11 0.000s
Alors it will work # tools/test-features/steps/steps.py:29 0.000s
1 feature passed, 0 failed, 0 skipped
2 scenarios passed, 0 failed, 0 skipped
5 steps passed, 0 failed, 0 skipped, 0 undefined @y4rk4s NEXT STEPS:
|
i forgot mention, i working under Windows 10 , i tried followings with this command:
|
Modified html.py line by the following
|
This problem likely still needs to be fixed. Related code: html.py:128-135 |
Thank you for the whole project and the hard work. |
Hi!
There are some issues with utf-8 character writing.
We are try to generated reports for Hungarian language, please check special characters bellow,
OS: Win10
Python: 3.8( / 3.6 )
Key: HU
Behave version: 0.98 ( with older version also reproducible )
variable is set on OS:
pythonioencoding=utf8
Command:
behave --tags=@smoke test_app/ --color --no-capture --no-skipped -f behave_html_formatter:HTMLFormatter
Special characters:
éáűőúöüóí
Case 1:
Formatter cannot handle propery characters above, on output only � appears
Case 2:
On a special chase stream contains character: "→" write to file causing exception, check details bellow
HTML output does not created
The text was updated successfully, but these errors were encountered: