GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — string scape must be integer · Issue #1652 · TypeScriptToLua/TypeScriptToLua

string scape must be integer #1652

New issue
Copy link
New issue
Copy link
Open
Open
string scape must be integer#1652
Copy link

Description

@RodrigoDornelles
RodrigoDornelles
opened on Aug 8, 2025
Issue body actions

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.

Currently, even if characters are escaped in hex in TypeScript, they remain special characters in Lua, which can cause compatibility issues and incorrect string interpretation.

typescript

console.log('atenção')
console.log('aten\xC3\xA7\xC3\xA3o')

lua (current)

print('atenção')
print('atenção')

lua (proposal)

print('aten\195\167\195\163o')
print('aten\195\167\195\163o')

As a practical example, I have created a JavaScript tool that performs this conversion and that I use daily for Lua 5.1 string escaping:

https://gly-engine.github.io/tool-lua51-text-escape

I 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.

Activity

  1. RodrigoDornelles commented on May 13, 2026

    @RodrigoDornelles
    RodrigoDornelles
    on May 13, 2026
    Author
    More actions

    The TypeScript function __TS__StringTrim emit non-ASCII characters.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.