Title: Add support for decoding CESU-8 encoded strings. by nlitsme · Pull Request #17 · tcalmant/python-javaobj · GitHub
Open Graph Title: Add support for decoding CESU-8 encoded strings. by nlitsme · Pull Request #17 · tcalmant/python-javaobj
X Title: Add support for decoding CESU-8 encoded strings. by nlitsme · Pull Request #17 · tcalmant/python-javaobj
Description: This works around java's broken utf-8 implementation. You will need the https://github.com/LuminosoInsight/python-ftfy module for the patch to have an effect. The following code will now output a 😃 ( \u0001f603 ), instead of raising a UnicodeDecodeError, or outputting ??????. from __future__ import division, print_function from binascii import a2b_hex import javaobj b = a2b_hex("ACED0005740006EDA0BDEDB883") print(javaobj.loads(b)) The problem with the byte sequence ED A0 BD ED B8 83 is that it decodes to d83d de03 which are invalid codepoints, but is actually a valid UTF-16 sequence, so you have to decode it twice, first utf-8, then utf-16, then you will end up with unicode character 0x1F603.
Open Graph Description: This works around java's broken utf-8 implementation. You will need the https://github.com/LuminosoInsight/python-ftfy module for the patch to have an effect. The following code will now outpu...
X Description: This works around java's broken utf-8 implementation. You will need the https://github.com/LuminosoInsight/python-ftfy module for the patch to have an effect. The following code will now o...
Opengraph URL: https://github.com/tcalmant/python-javaobj/pull/17
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6f7488b1-7973-f049-36a8-b653fbb21ed9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E9EC:CD10D:12CA2AF:184B0B3:696B1747 |
| html-safe-nonce | 1f6b09a0a8c445f3e34f2c8a1c6fce02a6f4d7ae167a71683428dae2f94fe82a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUVDOkNEMTBEOjEyQ0EyQUY6MTg0QjBCMzo2OTZCMTc0NyIsInZpc2l0b3JfaWQiOiIyMjk5MzY4Njc4NDk2MDgxNzM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | afd7e4aa03c92bab62ff77eef988cad1d51211c44c5ac21f38cb58aab9519fa1 |
| hovercard-subject-tag | pull_request:128152413 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/tcalmant/python-javaobj/pull/17/files |
| twitter:image | https://avatars.githubusercontent.com/u/252693?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/252693?s=400&v=4 |
| og:image:alt | This works around java's broken utf-8 implementation. You will need the https://github.com/LuminosoInsight/python-ftfy module for the patch to have an effect. The following code will now outpu... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/tcalmant/python-javaobj git https://github.com/tcalmant/python-javaobj.git |
| octolytics-dimension-user_id | 1540582 |
| octolytics-dimension-user_login | tcalmant |
| octolytics-dimension-repository_id | 15333794 |
| octolytics-dimension-repository_nwo | tcalmant/python-javaobj |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 15333794 |
| octolytics-dimension-repository_network_root_nwo | tcalmant/python-javaobj |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width