question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Encoding Problem - Windows Console

See original GitHub issue

If 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:closed
  • Created 8 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
TheJavaGuycommented, Nov 9, 2017

This seems to be fixed in 2.10.1 (and possibly in some earlier version too). Maybe this issue should be closed?

0reactions
sylvainlaurentcommented, Apr 10, 2017

I think the problem is in com.github.tomakehurst.wiremock.common.Strings.bytesFromString(String) where the call to str.getBytes(); depends on the current platform encoding. The correct call should be str.getBytes(UTF_8);.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found