toUTF8

Syntax

toUTF8(str, encode)

Arguments

str is a string scalar/vector.

encode is a string indicating the original encoding name. It must use lowercase.

Details

Change the encoding of strings to UTF-8.

For the Windows version, encode can only be "gbk".

Examples

toUTF8("DolphinDB","gbk");
// output
DolphinDB

toUTF8(["hello","world"],"euc-cn");
// output
["hello","world"]

Related functions: convertEncode, fromUTF8