Docker Community Forums

Share and learn in the Docker community.

Default encoding on Windows images

Hi,

First post/question for what I hope is a simple one. Here is my environment:

λ systeminfo | findstr /B /C:“OS Name” /C:“OS Version”
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.17763 N/A Build 17763

λ docker version
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:37 2019
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.24)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:36:50 2019
OS/Arch: windows/amd64
Experimental: false

Base image => mcr.microsoft.com/windows/servercore/iis

The default encoding is UTF-8:

PS C:> [System.Text.Encoding]::Default
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : True
CodePage : 65001

But I have a requirement for it to be Windows-1252 – here is my Windows 10 host equivalent output:
PS C:\Users\LaurentGalais> [System.Text.Encoding]::Default
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252

What’s the best approach for me to fix this? Do I need to download a different base image (I couldn’t find anything pointing to a specific encoding on DockerHub) – or do I need to set an autorun script?

Thanks in advance!

Laurent