Description
This function converts a buffer from one encoding language to another.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameters |
Type |
Description |
Possible values |
Example |
content |
string |
Required The file's contents. |
A string value. |
"hi" |
from_charset |
string |
The file's current character set encoding.
|
Any cPanel-supported character set encoding. |
UTF-8
|
to_charset |
string |
The character set encoding in which to encode the file. |
Any cPanel-supported character set encoding. |
ASCII
|
discard_illegal |
Boolean |
Whether to discard any characters that do not transcode correctly. |
|
1 |
transliterate |
Boolean |
Whether to transcode invaid characters to valid characters in the new character set encoding. |
|
0 |
Returns
Return |
Type |
Description |
Possible values |
Example |
content |
string |
The file content. |
A string value. |
"hi" |
charset |
string |
The file's new character set. |
A cPanel-supported character set encoding. |
ASCII |