Skip to content

fix NativeString encoding bug - #1281

Merged
uNetworkingAB merged 1 commit into
uNetworking:masterfrom
ValoChet:NativeString
Apr 22, 2026
Merged

fix NativeString encoding bug#1281
uNetworkingAB merged 1 commit into
uNetworking:masterfrom
ValoChet:NativeString

Conversation

@ValoChet

Copy link
Copy Markdown
Contributor

Using the String::ValueView optimization actually adds an encoding issue (#1280).
Seems like the ValueView gives access to an ISO-8859-1 code points encoded string while we need a utf-8 encoded string.
So it was working for strings having same representation in both encoding but not for the others.

This PR removes de String::ValueView optimization and only use the WriteUtf8() and WriteUtf8V2().
We loose a bit of performance but not that much thanks to the pool system, it is still much faster than the old Utf8Value copy.

binary: 157k Req/Sec
Utf8Value: 152k Req/Sec
ValueView: 158k Req/Sec
WriteUtf8: 155k Req/Sec
WriteUtf8V2: 156k Req/Sec

@uNetworkingAB
uNetworkingAB merged commit 8cb775f into uNetworking:master Apr 22, 2026
1 check failed
@uNetworkingAB

Copy link
Copy Markdown
Contributor

This PR removes the ref counting. So the pool is never reset?

@ValoChet

Copy link
Copy Markdown
Contributor Author

It does not remove it, I moved it to the alloc() and free() function level.
Because it is only needed for the pool system.
It count the number of pool allocated string.

@ValoChet
ValoChet deleted the NativeString branch April 25, 2026 07:33
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

Successfully merging this pull request may close these issues.

2 participants