question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Encoding.UTF8 caused Unhandled exception

See original GitHub issue

Hello. 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:open
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
skrustycommented, Sep 14, 2017

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.

0reactions
Deantwocommented, Oct 26, 2017

Hopefully fixed via #116. I don’t have a way to test it currently.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found