Add full support for `HIGHCHARUNICODE`
Fixes #368 by improving TextLiteralNode::characterEscapeToChar. Note that the interpretation of "ANSI encoding" is the system native encoding, so it is assumed that the system the Sonar scan runs on has the same native encoding as the system compiling the code.
One thing I forgot to note - I removed support for binary character escapes (e.g. #%11101110) since as far as I can tell Delphi does not recognise them.
The system encoding isn't what the compiler is using. The compiler is using the configured codepage, which may be 0, which means the system encoding.
Actually... let me check that.
It's a bit subtle, but I was right that the compiler does use the configured codepage for this kind of thing.
The reason it's subtle, is that if the type of the variable being assigned to is AnsiChar (or AnsiString), then the codepage at compile-time is irrelevant, because the bytes will be stored as written and interpreted at runtime. However if the type of the variable being assigned to is WideChar (or WideString), then any ANSI bytes from compile-time would have been converted to Unicode at compile time using the configured codepage.
I'm not sure how exactly this affects the change here, but I would expect the configured codepage to become involved at some point.