Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 1793698

Browse files
Support for international letters like øæå. (#13316)
Co-authored-by: Sverre Kristian Valskrå <Sverre.Valskra@skatteetaten.no>
1 parent 1f9f940 commit 1793698

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.io.IOException;
3636
import java.util.*;
3737
import java.util.function.Function;
38+
import java.util.regex.Pattern;
3839
import java.util.stream.Collectors;
3940
import java.util.stream.Stream;
4041

@@ -778,7 +779,7 @@ private String sanitizeKotlinSpecificNames(final String name) {
778779
}
779780

780781
// Fallback, replace unknowns with underscore.
781-
word = word.replaceAll("\\W+", "_");
782+
word = Pattern.compile("\\W+", Pattern.UNICODE_CHARACTER_CLASS).matcher(word).replaceAll("_");
782783
if (word.matches("\\d.*")) {
783784
word = "_" + word;
784785
}

0 commit comments

Comments
 (0)