Port 7.7 - WIP

This commit is contained in:
Stephan
2017-08-24 21:24:14 +02:00
parent ab8fc33691
commit 934d03e63f
44 changed files with 998 additions and 265 deletions

View File

@@ -314,9 +314,20 @@ function validateSafeAlias(input, value, immediate, callback) {{
// recode
var codeType = stringType & CleanStringType.CodeMask;
text = codeType == CleanStringType.Ascii
? Utf8ToAsciiConverter.ToAsciiString(text)
: RemoveSurrogatePairs(text);
switch (codeType)
{
case CleanStringType.Ascii:
text = Utf8ToAsciiConverter.ToAsciiString(text);
break;
case CleanStringType.TryAscii:
const char ESC = (char) 27;
var ctext = Utf8ToAsciiConverter.ToAsciiString(text, ESC);
if (ctext.Contains(ESC) == false) text = ctext;
break;
default:
text = RemoveSurrogatePairs(text);
break;
}
// clean
text = CleanCodeString(text, stringType, separator.Value, culture, config);