Avatar
Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
Cannot resolve windows console charset CP850
May 7, 2026
17:25, EEST
Avatar
rocket science
Member
Members
Forum Posts: 128
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi,

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?

May 8, 2026
10:46, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1105
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

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:

Active code page: 850

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.

May 8, 2026
11:26, EEST
Avatar
rocket science
Member
Members
Forum Posts: 128
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

Hi, here’s the output

C:\Users\home>chcp
Aktive Codepage: 850.

There is a dot at the end. Seems to be different with different system languages.

May 8, 2026
15:19, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1105
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

We will add logic to handle the dot output.

P.S.
One extra note for future readers. This was a DEBUG level log. On failure it should use Charset.defaultCharset() as a fallback. With that there would only be issues if there are non-ASCII characters in the outputs.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 43
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 146
rocket science: 114
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 904
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1587
Posts: 6693
Newest Members:
Taylorlly, heathdallachy85, dewittfrantz2, devonkeenan47, Michaelkam, chnmrc, ahmad.qureshi3@se.abb.com, connieorchard88, carlotae86, otiliabanks
Moderators: Jouni Aro: 1058, Pyry: 1, Petri: 1, Bjarne Boström: 1081, Jimmy Ni: 26, Matti Siponen: 370, Lusetti: 1
Administrators: admin: 1