Skip to content

CharsetNativeKt.platformUtf16 inaccessible outside main thread on native #53

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

Closed
fluidsonic opened this issue Jun 11, 2019 · 1 comment
Closed

Comments

@fluidsonic
Copy link

fluidsonic commented Jun 11, 2019

platformUtf16 is only accessible on the main thread because it is not marked as @SharedImmutable. That breaks String.toByteArray().

This also breaks Ktor HttpClient on non-main threads (TextContent.bytes).

private val platformUtf16: String by lazy { if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) "UTF-16BE" else "UTF-16LE" }

@fzhinkin
Copy link
Collaborator

We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version.

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