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

How to read UTF8 strings? #74

Open
m1dst opened this issue Mar 31, 2023 · 2 comments
Open

How to read UTF8 strings? #74

m1dst opened this issue Mar 31, 2023 · 2 comments

Comments

@m1dst
Copy link

m1dst commented Mar 31, 2023

Is there a way I can read UTF8 stings? The data I am receiving contains German characters and they appear to be corrupted. Likely being converted to ASCII. Is there a setting or a special method I need to use?

@9swampy
Copy link
Owner

9swampy commented Mar 31, 2023

Afraid not, out of the box; https://github.com/9swampy/Telnet/blob/develop/PrimS.Telnet.NetStandard/ByteStringConverter.cs

Swap that out or handle the bytestream yourself. If you make it more flexible I'd be happy to accept a PR :)

@m1dst
Copy link
Author

m1dst commented Apr 5, 2023

Look at the source, I don't think it is as easy as just swapping out ByteStringConverter. It looks like the read routines process the data one byte at a time. UTF8 characters are never going to be single bytes. They are probably 2 but could be more.

I think it is RetrieveAndParseResponse which processes the response stream and that is what would need to be changed. Not really sure how this can be changed without breaking what you have already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants