Encoding Problem - Windows Console
See original GitHub issueIf I run wiremock in windows in maven there is an encoding problem.
Wiremock is used for our tests. We set our maven encoding to “UTF-8”. (set MAVEN_OPTS= -Dfile.encoding="UTF-8"
)
I think wiremock will start without that encoding parameter, so it trys to convert the current UTF-8 encoded file again, because it use the standard windows encoding.
Is it possible setting the encoding parameter of files while wiremock configuration?
When I run the test in the IDE there is no problem (Because the Encoding matchs). Just if I run them in the console there are errors.
Here the jUnit Error:
org.junit.ComparisonFailure: expected:<...------
{
"text": "[üöäåÅשж໗🛀⟰п]"
}
----------------...> but was:<...------
{
"text": "[üöäåÅש�ж໗🛀⟰п]"
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:11
Top Results From Across the Web
Using UTF-8 Encoding (CHCP 65001) in Command Prompt ...
This answer shows how to switch the character encoding in the Windows console to. UTF-8 (code page 65001 ), so that shells such...
Read more >Change default code page of Windows console to UTF-8
To change the codepage for the console only, do the following: Start -> Run -> regedit; Go to [HKEY_LOCAL_MACHINE\Software\Microsoft\Command ...
Read more >Console Application Issues - Windows Console | Microsoft Learn
The best long-term solution for a console application is to use Unicode. The console will accept UTF-16 encoding on the W variant of...
Read more >Windows console output encoding issues #2214 - GitHub
Running various pulumi commands on Windows results in encoding issues with the output. For example: $ pulumi stack ls [38;5;1merror: ...
Read more >Console Character Encoding - KeePass Password Safe
The console character encoding can be changed to UTF-8, which is identified by code page 65001 (on Windows systems). UTF-8 allows encoding all...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This seems to be fixed in 2.10.1 (and possibly in some earlier version too). Maybe this issue should be closed?
I think the problem is in
com.github.tomakehurst.wiremock.common.Strings.bytesFromString(String)
where the call tostr.getBytes();
depends on the current platform encoding. The correct call should bestr.getBytes(UTF_8);
.