Giter Club home page Giter Club logo

Comments (7)

LoganDark avatar LoganDark commented on May 26, 2024

I could open a pull request if this is required. inspect.lua could check to see if each character is outside the printable range (20 - 126 inclusive) and then replace it with an escape sequence...

from inspect.lua.

LoganDark avatar LoganDark commented on May 26, 2024

Actually, hold on one minute.

it('escapes unnamed control characters with 1 or 2 digits', function()
assert.equals('"Here are some control characters: \\0 \\1 \\6 \\17 \\27 \\31"',
inspect('Here are some control characters: \0 \1 \6 \17 \27 \31'))
end)

Test case...

from inspect.lua.

mpeterv avatar mpeterv commented on May 26, 2024

So the problem is only with \127?

from inspect.lua.

LoganDark avatar LoganDark commented on May 26, 2024

image
Yes, as far as I can tell

from inspect.lua.

kikito avatar kikito commented on May 26, 2024

I didn't notice this issue was open, apologies for that.

Some people consider the DEL character (char code 127) as "printable". I must have used some resource that did that, but TBH I didn't even think about it. I believe that it should be displayed. I will mark this as a bug.

from inspect.lua.

LoganDark avatar LoganDark commented on May 26, 2024

Some people consider the DEL character (char code 127) as "printable".

Control characters shouldn't be output verbatim, even if lua strings are completely binary safe, since inspect.lua's purpose is to output something to be read by a person, at least as far as I know.

from inspect.lua.

kikito avatar kikito commented on May 26, 2024

Thanks for reporting this, I have released a fix that should properly escape DEL and released a new version of the luarock with it.

from inspect.lua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.