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.

Better C++ runtime error for non-UTF-8 content

See original GitHub issue

Passing a file with non-UTF-8 to a C+±runtime-compiled Antlr 4 parser typically yields an error like:

libc++abi.dylib: terminating with uncaught exception of type std::range_error: wstring_convert: from_bytes error

In this situation a user would greatly benefit from knowing 1) that their file has non-UTF-8 content (nothing in the error message indicates this) and 2) The (preceding-UTF-8-relative) line number and offset of the first non-UTF-8 bytes.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mike-lischkecommented, Oct 18, 2021

@parrt I don’t know of any PR for this issue.

0reactions
parrtcommented, Dec 13, 2021

Ok, thanks @iterumllc closing per your comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access Error: invalid UTF-8 encoding ${FFD8FFE0}
I have found a few commands such read where I can't execute the code because of the file encoding. save %/c/users/abagget/desktop/bay.jpg read ...
Read more >
utf-8 (Set source and execution character sets to UTF-8)
You can use the /utf-8 option to specify both the source and execution character sets as encoded by using UTF-8.
Read more >
Is it possible to set "locale" of a Windows application to UTF-8?
Starting in Windows 10 build 17134 (April 2018 Update), the Universal C Runtime supports using a UTF-8 code page.
Read more >
R6034 Runtime Error! An application has made an attempt to ...
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
Read more >
Programming for UTF-8 Encoding - NI - National Instruments
LabWindows/CVI detects and reports non-fatal runtime errors when a LabWindows/CVI library function receives a string whose bytes do not ...
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