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: patch-diff.githubusercontent.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:01d9af75-a4d2-b4d6-e301-2252ddaed3af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D490:1FA80:1717334:1FC1F38:6971E877 |
| html-safe-nonce | 947f409ae6f4b4a529dc3a6109e598eb92275e01626aa5155c53c672fd8a23ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDkwOjFGQTgwOjE3MTczMzQ6MUZDMUYzODo2OTcxRTg3NyIsInZpc2l0b3JfaWQiOiI3MjY1NjE0ODM4NTk4MDY4MzQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4496399cc69c71950863feb06019ba329ae5a3b82038bcae36007a5f19331730 |
| 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 | 683712716975b3393656edf09255a1d488d0e68ab7b9ac97e40ecf40036f696c |
| 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 | ed99da4e2de688dd1056894c1eccd4c82c6bbbfe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width