Redirect non english characters?

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
Can The List show non english characters? when there is non english characters, i see ??? in it
 
The context is Process RedirectStandardOutput.

I use this with StartInfo
.StandardOutputEncoding = System.Text.Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage)
 
Posts split to new thread. Consider starting a new thread if a new question arise that can better stand by itself in simplicity, but do explain the context briefly, not everyone know what you have been up to lately... :)
 
I have successfully used that to get correct encoding for console output in my local language. It is weird that yours Win10 should behave differently, especially for a common Windows exe. You could try open command prompt and enter the command 'chcp' to get the codepage. For me that returns code page 850 which is also what OEMCodePage returns for me. Other than that a custom console program may use almost any encoding, and System.Text.Encoding class has a few common encodings that you could give a try.
 
I take it the 'net file' output from command prompt (cmd.exe) is correct for these international characters? Since cp437 (OEM US) is basically Ascii you could then try Utf8 or Unicode encoding.
 
actually Openfiles show strange characters too. Do i need to set the language for non-unicode program in region setting in windows?
 
actually Openfiles show strange characters too.
Same question as in post 7, are you talking about the output in cmd?
Do i need to set the language for non-unicode program in region setting in windows?
No idea, don't think so, but can't be ruled out if you are using a US computer in an international environment. I thought that setting was for interpreting programs that output a specific encoding though.
 
You need to verify that output in command prompt is correct first. You can't get correct output in your .Net program if the source data is not correct in the first place. If the source is passing you incorrectly encoded chars as ??? then there is nothing you can do in your application to change that.
 
Yes, It is my window settings. I set the language for non-unicode program in region setting in windows? and now i can see the words without the encoding.
 
Last edited:
Back
Top