Title: Issue · GitHub
Open Graph Title: Issue · NexusDynamic/android_libcpp_shared
X Title: Issue · NexusDynamic/android_libcpp_shared
Description: Dart / flutter plugin for android to add libc++_shared.so - Issue · NexusDynamic/android_libcpp_shared
Open Graph Description: Dart / flutter plugin for android to add libc++_shared.so - Issue · NexusDynamic/android_libcpp_shared
X Description: Dart / flutter plugin for android to add libc++_shared.so - Issue · NexusDynamic/android_libcpp_shared
Opengraph URL: https://github.com/NexusDynamic/android_libcpp_shared
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"FormatException: Missing extension byte on non-English Windows","articleBody":"## Environment\nPackage: android_libcpp_shared v0.2.0\nOS: Windows 10/11 (Chinese / Japanese / Korean locale)\nDart SDK: ^3.12.0\n\n- Stack trace\n\n\n```code\nUnhandled exception:\nFormatException: Missing extension byte (at offset 1)\n#0 _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1964:7)\n#1 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:313:28)\n...\n#4 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:115:24)\n```\n\n\n- Root cause\nlib/src/process.dart lines 29–32 — runProcess() hardcodes utf8.decoder:\n\n```dart\nfinal stdoutFuture = process.stdout\n .transform(utf8.decoder) // ← the problem\n .transform(const LineSplitter())\n .forEach(stdout.writeln);\n```\nOn non-English Windows (e.g. Chinese/Japanese/Korean locale), where.exe outputs error messages in the system code page (e.g. CP936 for Chinese), not UTF-8:\n\n\n```code\nC:\\\u003e where ndk-build.cmd\n信息: 用提供的模式无法找到文件。 ← CP936 (GBK) encoded\n```\nFor example, the Chinese character 信 is encoded as 0xD0 0xC5 in GBK. utf8.decoder sees 0xD0 as a 2-byte UTF-8 lead byte and expects the next byte in range 0x80–0xBF. But 0xC5 is not in that range → FormatException is thrown.\n\nOn English Windows the output is pure ASCII (INFO: Could not find files...) so it never triggers.\n\nReproduction\n1.Use a non-English Windows system (Chinese / Japanese / Korean locale)\n2.Do NOT have ndk-build.cmd in PATH\n3.Build any Flutter project that depends on android_libcpp_shared\n\n```cmd\nwhere ndk-build.cmd\n# Outputs localized error → Dart process crashes with FormatException\n```\nSuggested fix\nUse platform-appropriate decoder in process.dart:\n\n\n```dart\nfinal encoding = Platform.isWindows ? systemEncoding : utf8;\nfinal stdoutFuture = process.stdout\n .transform(encoding.decoder)\n .transform(const LineSplitter())\n .forEach(stdout.writeln);\n// same for stderr\n```\nOr wrap the which() call with a try-catch for non-zero exit codes.","author":{"url":"https://github.com/wyq0918dev","@type":"Person","name":"wyq0918dev"},"datePublished":"2026-06-12T17:01:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4/android_libcpp_shared/issues/4"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:5ffebcbf-e2db-c082-7789-788f8a0dfefc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E4A6:7EDF5:156584:1F5843:6A4D05FF |
| html-safe-nonce | 715e4356783c0407a458cd077ab3511fa21770d39d8bfba18cb3cddded5449c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEE2OjdFREY1OjE1NjU4NDoxRjU4NDM6NkE0RDA1RkYiLCJ2aXNpdG9yX2lkIjoiMjAzNDg3MzkxMDgzOTU0MzI5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d719cf713afc34222c7613e845809ceb72dfac7bf718ea79de6a9c9abac5b241 |
| hovercard-subject-tag | repository:1184665524 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NexusDynamic/android_libcpp_shared/issues/4 |
| twitter:image | https://opengraph.githubassets.com/4a0a4030219ccc65448ae0201319252cbf7203b86c68262df87d69d67e6c573a/NexusDynamic/android_libcpp_shared |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4a0a4030219ccc65448ae0201319252cbf7203b86c68262df87d69d67e6c573a/NexusDynamic/android_libcpp_shared |
| og:image:alt | Dart / flutter plugin for android to add libc++_shared.so - Issue · NexusDynamic/android_libcpp_shared |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 31e4db13a9e20081f2fac78f441659a6576e582bbb15e153f9c7fb6473aa29f5 |
| turbo-cache-control | no-cache |
| go-import | github.com/NexusDynamic/android_libcpp_shared git https://github.com/NexusDynamic/android_libcpp_shared.git |
| octolytics-dimension-user_id | 215839682 |
| octolytics-dimension-user_login | NexusDynamic |
| octolytics-dimension-repository_id | 1184665524 |
| octolytics-dimension-repository_nwo | NexusDynamic/android_libcpp_shared |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1184665524 |
| octolytics-dimension-repository_network_root_nwo | NexusDynamic/android_libcpp_shared |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width