Skip to content

[ALL] Unicode characters in mustache template files aren't treated correctly #4544

@eblis

Description

@eblis
Description

There seems to be an inconsistency to the way files are treated when they're being read (like the mustache templates) and when their being written (the processed files after applying the mustache template). When files are written back to disk UTF-8 is enforced, but when the mustache files are first read UTF-8 is not enforced and the default OS value is used instead, which seems to mess things up on Windows systems.
I think it would make sense to assume that the input files are UTF-8 since we're enforcing that charset when writing files.

Swagger-codegen version

master @ 0fb154e

Swagger declaration file content or url

Let's take the JavaSpring template, spring-boot library and modify the Readme.md file to something like:
Spring_Boot_Server

Command line used for generation

-t <new, modified template>

Steps to reproduce
  1. Generate code for the JavaSpring language, spring-boot library using the new, modified template.
  2. The generated Readme.md file will not have the correct Spring_Boot_Server text (at least on Windows systems) as the template was read using a different charset than UTF-8.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions