Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging a null character causes an exception #77

Open
eemitev opened this issue Mar 28, 2023 · 3 comments
Open

Logging a null character causes an exception #77

eemitev opened this issue Mar 28, 2023 · 3 comments
Labels
question Further information is requested

Comments

@eemitev
Copy link

eemitev commented Mar 28, 2023

Serilog appears to handle NULL characters fine but printing it to a RichTextBox causes an issue.
If there is a NULL character in a string that is being logged, we end up with an unhandled exception.

msg = "\0";
Log.Information("{msg}", msg);
@augustoproiete
Copy link
Member

@eemitev Does the Console sink support NULL characters? What would would you expect to see on the RichTextBox for non-printable characters like these?

@augustoproiete augustoproiete added the question Further information is requested label Mar 28, 2023
@eemitev
Copy link
Author

eemitev commented Mar 28, 2023

The Console Sink appears to print garbage instead of the NULL character. My expectation would be to get a Unicode Symbol. Specifically U+2400 ␀ SYMBOL FOR NULL

@patiqs
Copy link

patiqs commented Nov 17, 2023

Same problem with some other chars like:
Log.Information("\u0002");
Log.Information("\u0002");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

3 participants