Unit 'LazUTF8' Package
[Overview][Types][Classes][Procedures and functions][Variables][Index] [#lazutils]

UTF8QuotedStr

Performs safe quoting for the specified UTF-8-encoded string value.

Declaration

Source position: lazutf8.pas line 142

function UTF8QuotedStr(

  const S: string;

  const Quote: string

):string;

Arguments

S

  

String with the values examined and quoted in the routine.

Quote

  

Byte sequence with the quote character used in the routine.

Function result

Value in S after safe UTF-8 quoting has been applied.

Description

UTF8QuotedStr is a String function used to double all occurrences of the byte sequence in the Quote argument. It works like the QuotedStr or AnsiQuotedStr routines from the RTL sysutils unit, but allows the Quote character to contain a valid multi-byte UTF-8 codepoint. Processing in the routine is halted when the #0 (Decimal 0) character is encountered.

Like its counterparts, UTF8QuotedStr encloses the return value with the character specified in the Quote argument.

See also

QuotedStr

AnsiQuotedStr