neon icon indicating copy to clipboard operation
neon copied to clipboard

"Invalid UTF-8 sequence" Exception

Open staabm opened this issue 10 months ago • 0 comments

Version: 3.3.4

Bug Description

when putting a invalid utf8 character into a neon file we get a "Invalid UTF-8 sequence" when loading said file back

Steps To Reproduce

decode the following NEON

parameters:
	ignoreErrors:
		-
			message: '#^Regex pattern is invalid\: Compilation failed\: UTF\-8 error\: byte 2 top bits not 0x80 at offset 0 in pattern\: \!�\[�\-�\]\!u$#'
			count: 1
			path: src/bug-12629.php

this error message happens for patterns like

Strings::match('', "![\x80-\x9f]!u")

Expected Behavior

I think the message should have "better escaping" at encoding time, so the string can be decoded without a exception

Possible Solution

n/a

staabm avatar Feb 23 '25 06:02 staabm