0

I have a really really long multiline string like 500 plus lines. It is a bunch of payloads used for testing and has quite a lot of special characters in it. So of course one of these special characters cause a problem and I got this error:

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 16321-16322: truncated \xXX escape

But the main problem is I can't find where the issue is cuz the error highlighting only highlights the beginning of the string and the error is at position 16321-16322, is there a way to find the error without counting my way there...

CrypticDev
  • 35
  • 6
  • 2
    Could you just use Python for this? `print(test_string[16310:16330])` – Kemp Jun 03 '21 at 11:50
  • 1
    You can use the method @kemp suggested to locate the special character. Then you can use the filter() to filter the content of the string. Check details in the following blog link https://www.tutsmake.com/python-remove-special-characters-from-string/ You can also prefilter special characters you dont need even without locating them for example ',;&* etc – A Modgil Jun 03 '21 at 12:15
  • @AModgil and thank you this made it easier – CrypticDev Jun 03 '21 at 12:42

0 Answers0