Help Center/ MapReduce Service/ Troubleshooting/ Using Hue/ Chinese Characters Entered in the Hue Text Box Are Displayed Incorrectly
Updated on 2024-09-18 GMT+08:00

Chinese Characters Entered in the Hue Text Box Are Displayed Incorrectly

Issue

Chinese characters entered in the Hue text box cannot be displayed correctly.

Symptom

When Chinese characters are entered for the first time, only English characters are displayed first. When the user enters Chinese characters again, the content entered the previous time is also displayed in addition to the Chinese characters. The following is an example:

Cause Analysis

Hue has a bug in processing Chinese characters.

Procedure

This solution applies only to MRS cluster versions 2.x and earlier.

  1. Log in to MRS Manager, choose Services > Hue > Instance, and obtain the IP address of the node where the Hue instance is located.
  2. Use a remote connection tool to log in to the node where the Hue instance resides as user root and run the following command to switch to user omm:

    su - omm

  3. Run the following command to switch to the target directory:

    cd /opt/Bigdata/MRS_Current/1_*_Hue/install/hue/build/static/desktop/js/ace

  4. Run the following command to locate the hash file of ace.js:

    ll ace.*.js

    The following is an example:

  5. Run the following command to open and edit the ace.*.js file (the hash file):

    vim ace.18f1745e9832.js

  6. Search for the keyword "t.onCompositionUpdate" in the ace.*.js file.

  7. Modify if (h.lastValue == e) (the content underlined in blue in the red box in the preceding figure) to if (true).

    The file after modification is as follows:

  8. Save the modifications.

    Perform 1 to 8 on each Hue instance node.

  9. Refresh the page and enter Chinese characters again.