Encoding.UTF8 caused Unhandled exception
See original GitHub issueHello. I experiment with AsterNET trying to get fields with some non English characters . If encoding is set to ASCII - then login successful, but all localized data is ??? ?? Otherwise, if it is set to UTF8 then i get on astCon.Login():
Unhandled exception type “AsterNET.Manager.ManagerException” in AsterNET.dll Additional info: Unable login to Asterisk - Missing action in request
Very similar issue discussed there https://asternet.codeplex.com/discussions/550564 but no answer till now.
Simple code from your examples (AstTray - little bit modified):
// Connecting to AMI
try
{
astCon = new ManagerConnection("192.168.1.1", 5038, "admin", "pass", Encoding.UTF8);
}
catch (Exception ex)
{
MessageBox.Show(string.Format("Error connecting to {0}. Error: {1}",
ConfigurationManager.AppSettings["astHost"],
ex.Message));
// Terminate Application
Application.Exit();
}
// ------------------------------------------------------------------------
// Set Event Handlers
astCon.NewState += astCon_NewState;
astCon.ConnectionState += astCon_ConnectionState;
astCon.UseASyncEvents = true;
// Login to AMI
astCon.Login();
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Android URLEncoder.encode unhandled exception java.io. ...
The reason you're getting this error is that some platforms might not support UTF-8 encoding. Android definitely does, so you'll never ...
Read more >How can I fix the UTF-8 error when bulk uploading users?
This error is created when the uploaded file isn't in a UTF-8 format. UTF-8 is the dominant character encoding format on the Internet....
Read more >How to reliably catch exceptions? - Microsoft Q&A
PostAsync' raises an unhandled exception. If the Console.WriteLine code of catch block is also not called, the problem is due to the try-catch...
Read more >How to solve UTF8 invalid byte sequence copy errors on a ...
The common solution is to use the plain text format dump and feed it through iconv to correct the encoding. Here is more...
Read more >java.io.UnsupportedEncodingException java code examples
Equivalent to {@code forName} but only throws {@code UnsupportedEncodingException}, * which is all pre-nio code claims to throw. * * @hide internal use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could we have some way of setting the encoding of values, without changing the socket encoding?
I.e. some way of saying when we populate a value from ManagerReader/Connection, the encoding to use for value types is XXX.
Hopefully fixed via #116. I don’t have a way to test it currently.