swagger-jsdoc-generator icon indicating copy to clipboard operation
swagger-jsdoc-generator copied to clipboard

When Unicode characters are included, the encoding is broken

Open myyrakle opened this issue 4 years ago • 1 comments

The bigger problem is that not only is the encoding broken, but the structure of the output json is also destroyed! If you enter Korean characters or Chinese characters, etc., the content may be broken or json's double quotes may disappear. image

The environment was windows 10, and the encoding of the source file was utf8.

The encoding format of the output file was utf16. Perhaps unifying the encoding format with utf8 could solve it. Can you solve this problem?

myyrakle avatar Jul 27 '20 13:07 myyrakle

Hello @myyrakle, thanks for submitting this issue. Would you like to contribute to the project by fixing this with a PR?

One option could be to make the encoding configurable through a dedicated CLI argument.

The main challenge would be that we should update one of the dependencies projects (https://github.com/Surnet/swagger-jsdoc) to support this use case first (https://github.com/Surnet/swagger-jsdoc/blob/b95d73456b22165a3df867b590f61bc2b889a20d/lib/helpers/parseApiFile.js#L11).

I opened issue https://github.com/Surnet/swagger-jsdoc/issues/206 as a starting point

lmammino avatar Jul 27 '20 20:07 lmammino