Title: [BUG] Bytes to string conversion function does not error for invalid code points · Issue #716 · cel-expr/cel-java · GitHub
Open Graph Title: [BUG] Bytes to string conversion function does not error for invalid code points · Issue #716 · cel-expr/cel-java
X Title: [BUG] Bytes to string conversion function does not error for invalid code points · Issue #716 · cel-expr/cel-java
Description: Describe the bug According to the language definition, string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points. However, cel-java does not error for invalid code points. To Reproduce string(b"\x...
Open Graph Description: Describe the bug According to the language definition, string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points. However, cel-java does not error for inval...
X Description: Describe the bug According to the language definition, string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points. However, cel-java does not error for in...
Opengraph URL: https://github.com/cel-expr/cel-java/issues/716
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] Bytes to string conversion function does not error for invalid code points","articleBody":"**Describe the bug**\n\nAccording to the language definition, \n\n\u003e `string(bytes) -\u003e string` converts a byte sequence to a UTF-8 string, errors for invalid code points. \n\nHowever, cel-java does not error for invalid code points.\n\n**To Reproduce**\n```cel\nstring(b\"\\xff\")\n```\n\n**Expected behavior**\n\nI would expect a runtime error, but the expression evaluates to `\"�\"` instead.\n\n\n**Additional context**\n\n[`bytes_to_string` calls `ByteString::toStringUtf8`](https://github.com/google/cel-java/blob/v0.9.1/runtime/src/main/java/dev/cel/runtime/CelStandardFunctions.java#L908). It should probably check `ByteString::isValidUtf8` first, and raise an error if that returns false.","author":{"url":"https://github.com/timostamm","@type":"Person","name":"timostamm"},"datePublished":"2025-06-06T13:44:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/716/cel-java/issues/716"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2b1b1cec-d658-52bd-5e52-1db5e654ad2a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8CE:3B88A6:11607B:177F89:6A4D7C69 |
| html-safe-nonce | 5ebf78dfef623180a8da9c5239390934c14b64ff142538056e91c0ddb6195867 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOENFOjNCODhBNjoxMTYwN0I6MTc3Rjg5OjZBNEQ3QzY5IiwidmlzaXRvcl9pZCI6IjI0NTM3NDk2NDE1ODMwOTg5ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4d0f41e1e98cb44fe09d933cb80270254a389dcb7fd1c1b18cb46c77b2b4d7a6 |
| hovercard-subject-tag | issue:3124834305 |
| 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/_view_fragments/issues/show/cel-expr/cel-java/716/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1f9a9319b068a21648bd4a4fd8bc9db75d5daed46dd8ea452ca138711bad7e56/cel-expr/cel-java/issues/716 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1f9a9319b068a21648bd4a4fd8bc9db75d5daed46dd8ea452ca138711bad7e56/cel-expr/cel-java/issues/716 |
| og:image:alt | Describe the bug According to the language definition, string(bytes) -> string converts a byte sequence to a UTF-8 string, errors for invalid code points. However, cel-java does not error for inval... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timostamm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f8e15305e2ab58890ca84b830615e375f5df303cf471cafcba0c08272981be3 |
| turbo-cache-control | no-preview |
| go-import | github.com/cel-expr/cel-java git https://github.com/cel-expr/cel-java.git |
| octolytics-dimension-user_id | 186625994 |
| octolytics-dimension-user_login | cel-expr |
| octolytics-dimension-repository_id | 587078119 |
| octolytics-dimension-repository_nwo | cel-expr/cel-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587078119 |
| octolytics-dimension-repository_network_root_nwo | cel-expr/cel-java |
| 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 | 8608b0750fc35e283e5ec5b094bff942d7a0e197 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width