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

Encoding.UTF8 is missing GetString(byteArray) #376

Closed
josesimoes opened this issue Jul 31, 2018 · 2 comments · Fixed by nanoframework/CoreLibrary#20
Closed

Encoding.UTF8 is missing GetString(byteArray) #376

josesimoes opened this issue Jul 31, 2018 · 2 comments · Fixed by nanoframework/CoreLibrary#20

Comments

@josesimoes
Copy link
Member

nanoFramework area (class library)

This is very handy in HTTP use case scenarios.

@piwi1263
Copy link
Member

Although probably not handy but you could try:

Encoding.UTF8.GetDecoder().Convert(data, 0, data.Length, _chars, 0, data.Length, false, out int _bytesUsed, out int _charsUsed, out bool _completed);
string tmp = new String(_chars, 0, _charsUsed).Trim('\r', '\n');

@josesimoes
Copy link
Member Author

Right now I'm using this workaround:

new String(Encoding.UTF8.GetChars(buffer)) 😉

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

Successfully merging a pull request may close this issue.

2 participants