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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:03e9578b-11fe-bba4-ab21-392bc56e897d |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | A34A:ECDF9:FF6A7D:1614B1E:696A925B |
| html-safe-nonce | 5ea12f085ad34a6b440c648866b0f6029bfd1986c25b5da93fde60ce474f81e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzRBOkVDREY5OkZGNkE3RDoxNjE0QjFFOjY5NkE5MjVCIiwidmlzaXRvcl9pZCI6IjUwNjg3NjIzNTgzMDEyMzM3NTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5c25cefd0c03a83af689fcb984464b0431ab99b45ac8d2dddfec15a9bb19f4ed |
| hovercard-subject-tag | pull_request:128152413 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | 4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7 |
| turbo-cache-control | no-preview |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31496a13b80a2f6ad77d6c617ee2255a3545b539 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width