convert_encoding
Convert a file's encoding to a specified character set. Auto-detects source encoding and rewrites the file in the target encoding.
Instructions
Converts a file's encoding to a different character set. Reads the file with auto-detected encoding, then rewrites it in the target encoding. Supports: UTF-8, UTF-8-BOM, EUC-KR, Shift_JIS, ISO-8859-1, UTF-16, ASCII, Windows-1252, Big5, GB18030. Example: convert EUC-KR file to UTF-8, or add/remove UTF-8 BOM.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | Absolute path to the file to convert | |
| path | No | Alias for file_path | |
| to_encoding | Yes | Target encoding. Examples: UTF-8, UTF-8-BOM, EUC-KR, Shift_JIS, ISO-8859-1 |