[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'System' (#rtl)

# UTF8Encode

Convert a widestring or unicodestring to an UTF-8 encoded ansistring

## Declaration

Source position: line 0

`function UTF8Encode(`
`const s: Ansistring`
`):UTF8String; function UTF8Encode(`
`const s: UnicodeString`
`):UTF8String; function UTF8Encode(`
`const s: WideString`
`):UTF8String;`

## Description

UTF8Encode converts an ansistring or widestring S to the equivalent UTF-8 encoded unicode string and returns this resulting string. It calls the low-level UnicodeToUTF8 function to do the actual work.

For this function to work, a widestring manager must be installed.

## See also

UTF8Decode |  | Convert an UTF-8 encoded ansistring to a unicodestring
Utf8ToAnsi |  | Convert a UTF-8 encoded unicode string to an ansistring
UnicodeToUtf8 |  |
SetWideStringManager |  | Set the widestring manager

Documentation generated on: Feb 26 2014