-
Notifications
You must be signed in to change notification settings - Fork 520
Description
Expected Behavior
I expect the file encoding to remain as UTF-8 after running ktlint with --format option regardless of the characters contained.
Observed Behavior
When the file contains some special characters ktlint changes the file encoding to ANSI
Steps to Reproduce
- Create a file in intellij with UTF-8 encoding
- Write a simple variable containing the following character §
- Close file
- Run ktlint on the file
- Open the file on intellij
- Wrong encoding is used, file is now ANSI encoded
Your Environment
-
Version of ktlint used: 1.2.1
-
Relevant parts of the
.editorconfig
settings:
[{.kt,.kt.ftl}]
max_line_length = off
indent_style = space
indent_size = 2
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 4
ktlint_standard_no-empty-first-line-in-class-body = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_value-argument-comment = disabled
ktlint_standard_value-parameter-comment = disabled
ktlint_standard_no-blank-line-in-list = disabled
ktlint_standard_filename = disabled
ij_kotlin_name_count_to_use_star_import = 999
ij_kotlin_name_count_to_use_star_import_for_members = 999 -
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): git-format-staged
-
Version of Gradle used (if applicable): N/A
-
Operating System and version: Windows 11