Description
This function attempts to retrieve a file's character encoding.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
file |
string |
Required The file. |
A valid absolute file path. |
/home/user/etc/example/public_html/index.html |
Returns
Return |
Type |
Description |
Possible values |
Example |
encoding |
string |
The file's character encoding. |
Any cPanel-known character encoding. |
ansi_x3.110-1983 |
file |
string |
The file's path. |
An absolute file path. |
/home/user/etc/example/passwd |
reason |
string |
A reason for failure. Note:
This function only returns areason value if there was an error.
|
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded.
|
|
1 |