question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escape or replace invisible or ambiguous characters when formatting strings

See original GitHub issue

Invisible characters such as zero-width joiner and non-breaking space, as well as ambiguous characters like other kinds of spaces, combining characters et cetera should be escaped when strings are formatted.

http://graphemica.com/blocks/control-pictures should be used where the behavior of the original character is preserved. This probably only applies to linebreaks.

If a simple escape sequence exist it should be used. Else characters should be escaped using the \u sequence.

When a string is formatted as a key it must not include linebreaks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
novemberborncommented, Apr 11, 2020

It’d be great if we could show byte differences when characters look the same, like in this example: https://github.com/avajs/ava/issues/2451

1reaction
novemberborncommented, Apr 8, 2018

ANSI codes should also be escaped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using character escapes in markup and CSS - W3C
Character escapes are a way of writing a character in markup using only ASCII code points. They are useful if you are unable...
Read more >
In R, How can I replace ambiguous characters in string with all ...
One way is to split the string, replace the ambiguous characters with their possible values, generate the possible combinations and paste ...
Read more >
Writing Invisible XML grammars
Invisible XML reports ambiguous parses, not ambiguous grammars. It's also possible to write a grammar that has loops in it: seq: 's', seq;...
Read more >
Power User Tips and Tricks - Word, Excel, Dreamweaver
"Find and replace text and other data in a Word document" ... To match these characters, prepend with the escape character \ ....
Read more >
Link Format (The Org Manual)
Functions inserting links (see Handling Links) properly escape ambiguous characters. You only need to bother about the rules above when inserting directly, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found