Topic RSS17:25, EEST
March 16, 2017
OfflineHi,
I’ve updated an application to SDK 5.6.2 (from 4.x) and there seems to be one exception in the log file.
Cannot resolve windows console charset
java.nio.charset.UnsupportedCharsetException: CP850.
at java.base/java.nio.charset.Charset.forName
at com.prosysopc.ua.stack.utils.OSUtil.eMY
at com.prosysopc.ua.stack.utils.OSUtil.a
at com.prosysopc.ua.stack.utils.OSUtil.exec
at com.prosysopc.ua.stack.utils.OSUtil.exec
at com.prosysopc.ua.stack.utils.OSUtil.eNa
at com.prosysopc.ua.stack.utils.OSUtil.eMZ
at com.prosysopc.ua.stack.utils.OSUtil.getDomainNameFromOs
at com.prosysopc.ua.stack.utils.OSUtil.getHostNameWithDomain
at com.prosysopc.ua.ApplicationIdentity.getActualHostName
One observation on the exception…
java.nio.charset.UnsupportedCharsetException: CP850.
…is that there is a dot at the end of CP850.
The Java class Charset does not add the dot at the end of the charset name when it throws the exception.
public static Charset forName(String charsetName) {
Charset cs = lookup(charsetName);
if (cs != null)
return cs;
throw new UnsupportedCharsetException(charsetName);
}
So my guess is as CP850 is valid, that somehow you have used ‘CP850.’ somewhere in your SDK instead of ‘CP850’
Can you check this?
10:46, EEST
April 3, 2012
OfflineHi,
On the machine that caused the log, could it be possible to see the output of the command “chcp” (without quotes) from the Command Prompt (specifically cmd, not powershell). It should output like this:
i.e. no dot at the end, but the number can be different on locales and regions. At least that it how it worked on the windows 10 and 11 machines we tested on.
A workaround would be to set the hostname manually (if you know it) via static ApplicationIdentity.setActualHostName(String), then SDK doesn’t try to figure out it by itself.
We can also try to improve the parsing logic once we see the output. It should be noted that normally at least currently the only scenario where SDK will try to use platform specific ways is if there is or has been Docker installed on the machine at some point. The Docker’s installation will write some hosts file entries that break Java’s reverse-DNS lookup for the hostname that we use. This would result in an unusable “host.docker.internal” hostname, thus as a fallback we will attempt platform specific ways. On windows the console output encodings can be different and it matters for reading because there can be special characters, thus we try to parse it from the chcp output.
11:26, EEST
March 16, 2017
Offline1 Guest(s)

Log In
Register