I have a program which reports errors/stack trace back to me in case of crash and if user wishes to send it.
Occasioanly I receive wierd charcters in error message and also stack trace as you can see below.
ファイルã¾ãŸã¯ã‚¢ã‚»ãƒ³ãƒ–リ 'Interop.iTunesLib, Version=1.11.0.0, Culture=neutral, PublicKeyToken=null'ã€ã¾ãŸã¯ãã®ä¾å˜é–¢ä¿‚ã® 1 ã¤ãŒèªã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸã€‚指定ã•れãŸãƒ•ァイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。
stack trace
------------------------------------------------------
å ´æ‰€ STLib.TInfo.Init(Form f)
å ´æ‰€ STLib.FormMain..ctor() å ´æ‰€ C:\repo_sync\ST\FormMain.cs:行 37
å ´æ‰€ STLib.Program.Main() å ´æ‰€ C:\repo_sync\ST\Program.cs:行 54
My code that builds up the stack trace looks like this
private static void GlobalThreadExceptionHandler(object sender, System.Threading.ThreadExceptionEventArgs e)
{
...
String stackTrace = "";
Exception currentEx = e;
do
{
stackTrace += string.Format("\r\n{0}", currentEx.Message);
stackTrace += "\r\n------------------------------------------------------";
stackTrace += string.Format("\r\n{0}", currentEx.StackTrace);
currentEx = currentEx.InnerException;
if (currentEx != null)
{
stackTrace += "\r\nCaused by";
}
}
while (currentEx != null);
.....
}
I guess probably it has to do Non English language of that machine, can someone please advise me on this as to whats wrong here..
Added after Hans Pasant's comment
I have following code which converts the stack trace to bytes before posting to a web..
byte[] postdata = System.Text.Encoding.UTF8.GetBytes(stackTrace)
I post this data using exactly the same code as here
Multipart forms from C# client posted by Brian Grinstead