Garry's Mod Wiki

utf8.force

  string utf8.force( string string )

Description

Forces a string to contain only valid UTF-8 data. Invalid sequences are replaced with U+FFFD (the Unicode replacement character).

This is a lazy way for users to ensure a string contains only valid UTF-8 data.

Arguments

1 string string
The string that will become a valid UTF-8 string.

Returns

1 string
The UTF-8 string.