Title: string scape must be integer · Issue #1652 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: string scape must be integer · Issue #1652 · TypeScriptToLua/TypeScriptToLua
X Title: string scape must be integer · Issue #1652 · TypeScriptToLua/TypeScriptToLua
Description: If we are going to use hex escapes or even special characters like ã, á, à in TypeScript targeting Lua, it is important that they are escaped in Lua 5.1’s decimal escape format (\ddd) for better compatibility. This is because Lua 5.1 doe...
Open Graph Description: If we are going to use hex escapes or even special characters like ã, á, à in TypeScript targeting Lua, it is important that they are escaped in Lua 5.1’s decimal escape format (\ddd) for better co...
X Description: If we are going to use hex escapes or even special characters like ã, á, à in TypeScript targeting Lua, it is important that they are escaped in Lua 5.1’s decimal escape format (\ddd) for better co...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1652
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"string scape must be integer","articleBody":"If we are going to use hex escapes or even special characters like `ã`, `á`, `à` in TypeScript targeting Lua, it is important that they are escaped in Lua 5.1’s decimal escape format (\\ddd) for better compatibility. **This is because Lua 5.1 does not support hexadecimal escapes**, and using decimal escapes is the best way to correctly represent UTF-8 bytes.\n\nCurrently, even if characters are escaped in hex in TypeScript, they remain special characters in Lua, which can cause compatibility issues and incorrect string interpretation.\n\n**typescript**\n\n```js\nconsole.log('atenção')\nconsole.log('aten\\xC3\\xA7\\xC3\\xA3o')\n```\n\n**lua (current)**\n```lua\nprint('atenção')\nprint('atenção')\n```\n\n**lua (proposal)**\n```lua\nprint('aten\\195\\167\\195\\163o')\nprint('aten\\195\\167\\195\\163o')\n```\n\nAs a practical example, I have created a JavaScript tool that performs this conversion and that I use daily for Lua 5.1 string escaping:\n\nhttps://gly-engine.github.io/tool-lua51-text-escape\n\nI would like to open a GitHub issue to have this considered and fixed, since it affects portability and proper UTF-8 string handling when converting TS code to Lua 5.1.","author":{"url":"https://github.com/RodrigoDornelles","@type":"Person","name":"RodrigoDornelles"},"datePublished":"2025-08-08T19:51:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1652/TypeScriptToLua/issues/1652"}
| 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:48dcde55-2704-f864-d2ab-34b61160e480 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E616:2FF188:EEFA5A:143A463:6972978E |
| html-safe-nonce | dc0f90cd5be9594f51d97f3da817d3c14aa7a285c49bf1e33889f0819dbd54f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjE2OjJGRjE4ODpFRUZBNUE6MTQzQTQ2Mzo2OTcyOTc4RSIsInZpc2l0b3JfaWQiOiIyNDQ4MzA0MjA1ODk1MTY2ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8235dea6272928a24924082a9bcc91931176a25956c6bf764988124587149459 |
| hovercard-subject-tag | issue:3305065795 |
| 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/TypeScriptToLua/TypeScriptToLua/1652/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe94fd15678a38b73a7bffa6dea9c5157b62e1f0a0692566f0ea16339417d651/TypeScriptToLua/TypeScriptToLua/issues/1652 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe94fd15678a38b73a7bffa6dea9c5157b62e1f0a0692566f0ea16339417d651/TypeScriptToLua/TypeScriptToLua/issues/1652 |
| og:image:alt | If we are going to use hex escapes or even special characters like ã, á, à in TypeScript targeting Lua, it is important that they are escaped in Lua 5.1’s decimal escape format (\ddd) for better co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RodrigoDornelles |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| turbo-cache-control | no-preview |
| go-import | github.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git |
| octolytics-dimension-user_id | 44121206 |
| octolytics-dimension-user_login | TypeScriptToLua |
| octolytics-dimension-repository_id | 115876595 |
| octolytics-dimension-repository_nwo | TypeScriptToLua/TypeScriptToLua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 115876595 |
| octolytics-dimension-repository_network_root_nwo | TypeScriptToLua/TypeScriptToLua |
| 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 | 7b2326416cb9f2fa4ab7b6ede33ad46d0dd431a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width