F# Interactive Encoding #779

Open
FallenPhoenix opened this Issue Sep 28, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@FallenPhoenix

FallenPhoenix commented Sep 28, 2016

Hello again.
I found one more encoding issue, and now its FSI.exe process.
It should be current system language OEM encoding, because there language pack available:
https://www.microsoft.com/en-us/download/details.aspx?id=48179

FSharpInteractive.cs, lines starting from 76:

            if (foundCompiler) {
                var encoding = Encoding.ASCII;
                var lang = System.Globalization.CultureInfo.CurrentUICulture;
                var bin_path = Path.GetDirectoryName(fsiProcess.StartInfo.FileName);
                if (File.Exists(string.Format(@"{0}\{1}\Fsi.resources.dll", bin_path, lang.Name)));
                    encoding = Encoding.GetEncoding(lang.TextInfo.OEMCodePage);
                //fsiProcess.StartInfo.Arguments <- "--fsi-server sharpdevelopfsi";
                fsiProcess.StartInfo.UseShellExecute = false;
                fsiProcess.StartInfo.CreateNoWindow = true;
                fsiProcess.StartInfo.RedirectStandardError = true;
                fsiProcess.StartInfo.RedirectStandardInput = true;
                fsiProcess.StartInfo.RedirectStandardOutput = true;
                fsiProcess.StartInfo.StandardErrorEncoding = encoding;
                fsiProcess.StartInfo.StandardOutputEncoding = encoding;
                fsiProcess.EnableRaisingEvents = true;

Maybe it's not absolutely correct fix, but for me it works (Russian locale), and probably for other supported languages too.

Full path for Russian resource dll for me is:
C:\Program Files (x86)\Microsoft F#\v4.0\ru\Fsi.resources.dll

@FallenPhoenix

This comment has been minimized.

Show comment
Hide comment
@FallenPhoenix

FallenPhoenix Oct 17, 2016

Maybe also possible to use this OemEncoding instead (screenshot from 3rd version):
image

Maybe also possible to use this OemEncoding instead (screenshot from 3rd version):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment