Top-Q / difido-reports

This project aims to provide a generic implementation for HTML test reports.
http://top-q.github.io/difido-reports
Apache License 2.0
47 stars 31 forks source link

Supporting of UTF encoding in Windows machines #166

Closed sapastukhov closed 6 years ago

sapastukhov commented 7 years ago

Difido report does not support cyrillic. Can you add support of UTF-8 format or something else to see the cyrillic chars? Or may be I simply dont know how to turn on this opportunity.

image

itaiag commented 7 years ago

Hi.

Please provide the binder that you are using (NUnit, TestNG, JSystem), and the Difido version.

sapastukhov commented 7 years ago

JSystem, in the runtime reporter all is ok. JSystem version 6.1.05. Cant say what version of the Difido reporter associated with it.

sapastukhov commented 7 years ago

Is it possible to solve it? Could you answer please?

itaiag commented 7 years ago

The Difido reports and JSystem are using UTF-8 by default, so I am not sure why you can't see Cyrilic fonts. I tried to reproduce it with the following test:

    @Test
    public void testCyrillic() throws Exception {
        report.step("About to print cyrillic text");
        report.report("ЗАПИСЬ!!!");
    }

And I got the following report

screenshot from 2017-10-08 13-05-49

If you still see the problem, please provide more detailed steps that will allow me to reproduce the problem.

sapastukhov commented 7 years ago

It is really strange, I still see an issue. JSystem shows correctly

image but Difido shows

image

I have found, that this specific character � is usually the sign of an invalid (non-UTF-8) character showing up in an output (like a page) that has been declared to be UTF-8. But cyrillic is UTF-8.. I dont know what happens) I tried with different browsers, but it did not help.

itaiag commented 7 years ago

I tried it with JSystem 6.1.05, Chrome and Firefox and still could not reproduce the problem. I am keeping the issue open for now in hope that I will be able to reproduce it sometime (or better yet, it will miraculously start working on your environment :)).

sapastukhov commented 7 years ago

Big thanks, I will try to find out what`s going wrong in my environment.

sapastukhov commented 7 years ago

Interesting moment, it seems there are problems with .js files, which were generated for reports. When I decode them manually via notepad++ into UTF-8 without BOM, reports are showing normally without question marks in a black diamond. Why tag meta charset="utf-8" in html files does not work for js scripts, I dont understand. So, maybe it is a problem in JSystem, that it does not save js files in UTF-8 encoding, but strange that you cant reproduce it.

sapastukhov commented 6 years ago

Can you tell the setup which you used, where problem is not reproducible? Maybe OS, IDE are important. I am using WIndows 10 with Eclipse, but JSystem continues to save .js files in non-itf-8.

sapastukhov commented 6 years ago

Thanks for the fix Itai. When do you plan to add new difido version to the JSystem project?