LazUtf8: leftpad escaped characters in Utf8EscapeControlChars if EscapeMode = emPascal. Prevents ambiguity when reading the result.

git-svn-id: trunk@59125 -
This commit is contained in:
bart 2018-09-22 09:57:01 +00:00
parent c5bdbc4020
commit 70f0e3209a

View File

@ -2888,8 +2888,8 @@ function Utf8EscapeControlChars(S: String; EscapeMode: TEscapeMode = emPascal):
const
//lookuptables are about 1.8 to 1.3 times faster than a function using IntToStr or IntToHex
PascalEscapeStrings: Array[#0..#31] of string = (
'#0' , '#1' , '#2' , '#3' , '#4' , '#5' , '#6' , '#7' ,
'#8' , '#9' , '#10', '#11', '#12', '#13', '#14', '#15',
'#00', '#01', '#02', '#03', '#04', '#05', '#06', '#07',
'#08', '#09', '#10', '#11', '#12', '#13', '#14', '#15',
'#16', '#17', '#18', '#19', '#20', '#21', '#22', '#23',
'#24', '#25', '#26', '#27', '#28', '#29', '#30', '#31');
CEscapeStrings: Array[#0..#31] of string = (