[perl #59908] \x, \0, and \N{} not ok in double-quotish when followed by > \x100
Attached is a patch for this problem.
The root cause was that S_scan_const() was not recoding to utf8 under
some circumstances when it should be.
I also changed it so that in all places, the flag that indicates the
output is in utf8 is changed from false to true if and only if the
destination is recoded to utf8. One place was skipping this, and then
setting it unconditionally later on.
In one place in the routine, the routine had code to do the recoding
itself. In the other places, it called sv_utf8_upgrade(). I changed it
to call the subroutine in all cases.
I fixed a bug that would appear only on EBCDIC machines where constants
of the form \N{U+....} would have been interpreted as EBCDIC.
And in inspecting the code, I realized there were problems with growing
the scalar value to fit the input. I cleaned those up.
I also added a number of comments to document things I found out, and
changed some existing ones to be more accurate.
Since no one responded to my request for where to put the test cases,
and I couldn't figure out a good place to put them, I added a new test
file, t/uni/lex_utf8.t.