The default system character encoding format is GBK. In this format, users can enter only Chinese and English characters in the GBK encode table when configuring parameters such as policies names and user names. The characters of other languages (such as German and French) are not supported. If a language that GBK does not support is used, switch the system character encoding format to UTF-8.
The encoding format can be switched only in English mode (language-mode).
Context
If no GBK-unsupported characters are used, do not switch the encoding format. Once the encoding format is switched, the Chinese web UI and CLI are unavailable.
If the UTF-8 format is required, you are strongly recommended to switch the default format to UTF-8 before configuring any services. Otherwise, some configurations may not be automatically transcoded. In addition, if the device has user authentication-related or SSL VPN configurations, the device will be restarted during transcoding, interrupting services.
You cannot switch the UTF-8 encoding format back to GBK unless you restore the configuration file and database that was previously backed up. Therefore, exercise cautions for transcoding.
[sysname] set old-encoding-charset mode { gbk | utf-8 }
As the configuration delivered through the web UI can only be in the GBK format, while the configuration delivered through the CLI can be in the UTF-8 format (depending on the CLI terminal), these two encoding formats may co-exist on the FW. In this case, even if the original encoding format is specified, not all configurations can be successfully transcoded.
[sysname] language character-set utf-8 Warning: Note the following points when setting the encoding mode to UTF-8: 1.Set the encoding mode to the original one first. The default encoding mode is GBK. //This has been completed in step 1. The default mode is GBK. 2.The UTF-8 mode is not applicable to the working environment in Chinese. After code conversion, the Chinese UI is unavailable. 3.You cannot switch to the original encoding mode after setting the encoding mode to UTF-8. 4.When different encoding modes exist, the encoding modes may be incompatible after code conversion. 5.After the encoding is complete, the encoding configuration is automatically saved. If the current configuration is different from those in the configuration file for next startup, back up the startup file.(Check inconsistent configurations command: compare configuration) 6.The code conversion takes a long period. Do not perform other configurations or disconnect the power supply during the period. Are you sure to continue?[Y/N]y Info:The original encoding mode of the device is GBK. Prepare the backup configuration. Info:Successful backup configuration to "hda1:/charset_backup/charset_back.cfg". //Backup the current configuration. Checking the configuration compatibility. Info:No exception configurations are found. //The information is displayed if the device needs to be restarted. Warning:After the encoding is complete, the encoding configuration is automatically saved, and the device is automatically restarted. Are you sure to continue the switching?[[Y/N]y //The information is displayed if the device does not need to be restarted. Warning:After the encoding is complete, the encoding configuration is automatically saved. Are you sure to continue the switching?[Y/N]y Info:The system starts configuration conversion. Please wait. During this period, do not disconnect the power supply. Info:The configuration conversion is complete. The encoding mode is UTF-8.
If "Error: Exception configurations are detected. Perform code conversion again after deleting the exception configurations." is displayed during configuration compatibility check, some configurations cannot be properly transcoded. In this case, you must run the following command to view exception configurations, delete or modify them, and perform the transcoding command again until "No exception configurations are found." is displayed.
<sysname> display language charset exception configuration Module[Security-Policy]:AbnormalCmdNum<1>,Check Error Vsys[public],Cmd:rule name XXXX
The command output indicates that the rule name configured using the rule name XXXX command for the security policy module. This configuration must be deleted or modified.
The exception configurations include overlong configurations after transcoding and configurations that cannot be transcoded. UTF-8 is a variable-length encoding format. Each character contains 1 to 6 bytes. After the encoding format is switched to UTF-8, some character strings entered in the previous GBK format may fail to be transcoded because their length exceeds that for UTF-8.
In the report scheduling configuration, if the name of the customized report (log custom-report policy policy-name) contains non-ASCII characters (except letters, digits, and symbols) or the report language mode (custom-report language { chinese | english }) is Chinese, the system displays a message indicating that the encoding format cannot be switched. In this case, delete or modify the report scheduling configuration and then switch the encoding format. The name of a customized report can contain only ASCII characters.
During encoding format switching, the FW automatically backs up the original configuration file and user management database to the /charset_backup directory.
<system> cd /charset_backup
<system> dir
Idx Attr Size(Byte) Date Time FileName
0 -rw- 35,840 Nov 03 2017 15:30:34 usermanage.db
1 -rw- 59,141 Nov 03 2017 18:20:00 charset_back.cfg
If the original configuration file has the SSL VPN configuration, the database cannot be rolled back. Therefore, the encoding format cannot be switched backed to GBK. If the original configuration file does not have the SSL VPN configuration and you have to switch back the encoding format, perform the following steps. Exercise caution before performing encoding format switching to prevent the rollback operation. The rollback operation is complex and has a specific risk.
The device may be restarted during transcoding, to prevent service interruption, you should perform transcoding on the standby device first, manually switching between the active and standby devices, and perform transcoding on the original active device.
The device is restarted only when there are configurations related to user authentication. The device automatically determines whether a restart is needed. If needed, the device displays a message, indicating that transcoding can be performed only on the standby device.
During transcoding, do not deliver configurations irrelevant to transcoding on the active or standby FW. Otherwise, the configuration backed up from the active device may inconsistent with that on the standby device.
HRP_M[sysname] interface GigabitEthernet 0/0/1 HRP_M[sysname-GigabitEthernet 0/0/1] shutdown
HRP_S[sysname] interface GigabitEthernet 0/0/1 HRP_S[sysname-GigabitEthernet 0/0/1] undo shutdown
The device is restarted only when there are configurations related to user authentication. The device automatically determines whether a restart is needed. If needed, the device displays a message, indicating that transcoding can be performed only on the standby device.
During transcoding, do not deliver configurations irrelevant to transcoding on the active or standby FW. Otherwise, the configuration backed up from the active device may inconsistent with that on the standby device.
HRP_S[sysname] interface GigabitEthernet 0/0/1 HRP_S[sysname-GigabitEthernet 0/0/1] shutdown
HRP_S[sysname] interface GigabitEthernet 0/0/1 HRP_S[sysname-GigabitEthernet 0/0/1] undo shutdown
HRP_M[sysname] interface GigabitEthernet 0/0/1 HRP_M[sysname-GigabitEthernet 0/0/1] shutdown
HRP_S[sysname] interface GigabitEthernet 0/0/1 HRP_S[sysname-GigabitEthernet 0/0/1] undo shutdown