Subject: GUI Guider Generates Invalid C Identifiers When Using Chinese Characters for Tab Names

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Subject: GUI Guider Generates Invalid C Identifiers When Using Chinese Characters for Tab Names

1,930 Views
yyxy
Contributor I
Dear NXP Support Team,
I am using GUI Guider (vX.X.X) to design an interface that contains an lv_tabview widget with several tabs.
When I type Chinese characters (e.g. “设置”, “关于”) in the tab-text field, Guider automatically re-uses the same string as the C identifier for the tab object. As a result, the generated code looks like:
This produces a compiler error because the C language does not allow non-ASCII identifiers.
Could you please consider one of the following improvements in a future release?
  1. Split the two concepts
    • Provide two separate input boxes:
      – “Display text” (any Unicode string)
      – “Object ID / variable name” (restricted to ASCII letters, digits and underscore)
    • Use the Object ID only in the generated C code, and keep the Display text for the label that appears on screen.
  2. Automatic sanitisation
    • If the user enters Unicode text, silently transliterate it to a valid C identifier (e.g. “设置” → “tab_setting”) while preserving the original Unicode string for the label.
  3. Built-in i18n support
    • Always store an English/ASCII ID internally, and let the user supply translations through the existing internationalisation table. This is already possible, but it is not obvious to new users because the single input box implies that the typed text will be used verbatim in the code.
At the moment the only workaround is to:
  • type an English ID first,
  • generate the code,
  • then manually change the label text back to Chinese,
    which is tedious and error-prone.
Thank you for your attention. I would appreciate any feedback on whether this enhancement can be placed on the roadmap.
Best regards,1.png2.png3.png
0 Kudos
Reply
5 Replies

1,869 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yyxy 

I try to change it to Chinese.

Harry_Zhang_0-1764059502687.png

And i can compile it successfully.

Which version you are using?

BR

Harry

0 Kudos
Reply

1,859 Views
yyxy
Contributor I
try to add events to the"报警设置"
0 Kudos
Reply

1,855 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yyxy 

Thanks for your information.

BR

Harry

0 Kudos
Reply

1,853 Views
yyxy
Contributor I
Could you please let me know **roughly when the optimization will be completed**?
0 Kudos
Reply

1,792 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @yyxy 

At present, we do not support this operation, but I have forwarded your suggestion to our GUI GUIDER team. We will address this issue in future versions.

Thank you for your understanding.

BR

Harry

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2246774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESubject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2246774%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%20class%3D%22%22%3EDear%20NXP%20Support%20Team%2C%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EI%20am%20using%20GUI%20Guider%20(vX.X.X)%20to%20design%20an%20interface%20that%20contains%20an%20lv_tabview%20widget%20with%20several%20tabs.%3CBR%20%2F%3EWhen%20I%20type%20Chinese%20characters%20(e.g.%20%E2%80%9C%E8%AE%BE%E7%BD%AE%E2%80%9D%2C%20%E2%80%9C%E5%85%B3%E4%BA%8E%E2%80%9D)%20in%20the%20tab-text%20field%2C%20Guider%20%3CSTRONG%3Eautomatically%20re-uses%20the%20same%20string%20as%20the%20C%20identifier%3C%2FSTRONG%3E%20for%20the%20tab%20object.%20As%20a%20result%2C%20the%20generated%20code%20looks%20like%3A%3CDIV%20class%3D%22%22%3EThis%20produces%20a%20%3CSTRONG%3Ecompiler%20error%3C%2FSTRONG%3E%20because%20the%20C%20language%20does%20not%20allow%20non-ASCII%20identifiers.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3ECould%20you%20please%20consider%20one%20of%20the%20following%20improvements%20in%20a%20future%20release%3F%3C%2FDIV%3E%3COL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3ESplit%20the%20two%20concepts%3C%2FSTRONG%3E%3C%2FDIV%3E%3CUL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EProvide%20two%20separate%20input%20boxes%3A%3CBR%20%2F%3E%E2%80%93%20%E2%80%9CDisplay%20text%E2%80%9D%20(any%20Unicode%20string)%3CBR%20%2F%3E%E2%80%93%20%E2%80%9CObject%20ID%20%2F%20variable%20name%E2%80%9D%20(restricted%20to%20ASCII%20letters%2C%20digits%20and%20underscore)%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EUse%20the%20Object%20ID%20only%20in%20the%20generated%20C%20code%2C%20and%20keep%20the%20Display%20text%20for%20the%20label%20that%20appears%20on%20screen.%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3EAutomatic%20sanitisation%3C%2FSTRONG%3E%3C%2FDIV%3E%3CUL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EIf%20the%20user%20enters%20Unicode%20text%2C%20silently%20transliterate%20it%20to%20a%20valid%20C%20identifier%20(e.g.%20%E2%80%9C%E8%AE%BE%E7%BD%AE%E2%80%9D%20%E2%86%92%20%E2%80%9Ctab_setting%E2%80%9D)%20while%20preserving%20the%20original%20Unicode%20string%20for%20the%20label.%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3E%3CSTRONG%3EBuilt-in%20i18n%20support%3C%2FSTRONG%3E%3C%2FDIV%3E%3CUL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3EAlways%20store%20an%20English%2FASCII%20ID%20internally%2C%20and%20let%20the%20user%20supply%20translations%20through%20the%20existing%20internationalisation%20table.%20This%20is%20already%20possible%2C%20but%20it%20is%20not%20obvious%20to%20new%20users%20because%20the%20single%20input%20box%20implies%20that%20the%20typed%20text%20will%20be%20used%20verbatim%20in%20the%20code.%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FOL%3E%3CDIV%20class%3D%22%22%3EAt%20the%20moment%20the%20only%20workaround%20is%20to%3A%3C%2FDIV%3E%3CUL%3E%3CLI%3E%3CDIV%20class%3D%22%22%3Etype%20an%20English%20ID%20first%2C%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3Egenerate%20the%20code%2C%3C%2FDIV%3E%3C%2FLI%3E%3CLI%3E%3CDIV%20class%3D%22%22%3Ethen%20manually%20change%20the%20label%20text%20back%20to%20Chinese%2C%3CBR%20%2F%3Ewhich%20is%20tedious%20and%20error-prone.%3C%2FDIV%3E%3C%2FLI%3E%3C%2FUL%3E%3CDIV%20class%3D%22%22%3EThank%20you%20for%20your%20attention.%20I%20would%20appreciate%20any%20feedback%20on%20whether%20this%20enhancement%20can%20be%20placed%20on%20the%20roadmap.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EBest%20regards%2C%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366928i34170E75D9125EBE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366927i2640E8F5D0261883%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20858px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20858px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20858px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366926i4F110554B1A8670D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248250%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Subject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248250%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECould%20you%20please%20let%20me%20know%20**roughly%20when%20the%20optimization%20will%20be%20completed**%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Subject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248249%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257224%22%20target%3D%22_blank%22%3E%40yyxy%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20information.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248215%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Subject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248215%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Etry%20to%20add%20events%20to%20the%22%E6%8A%A5%E8%AD%A6%E8%AE%BE%E7%BD%AE%22%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248172%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Subject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248172%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257224%22%20target%3D%22_blank%22%3E%40yyxy%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20try%20to%20change%20it%20to%20Chinese.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Harry_Zhang_0-1764059502687.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1764059502687.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Harry_Zhang_0-1764059502687.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F367111i39EFEEFCC98251B7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Harry_Zhang_0-1764059502687.png%22%20alt%3D%22Harry_Zhang_0-1764059502687.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAnd%20i%20can%20compile%20it%20successfully.%3C%2FP%3E%0A%3CP%3EWhich%20version%20you%20are%20using%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2249940%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Subject%3A%20GUI%20Guider%20Generates%20Invalid%20C%20Identifiers%20When%20Using%20Chinese%20Characters%20for%20Tab%20Names%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2249940%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257224%22%20target%3D%22_blank%22%3E%40yyxy%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20present%2C%20we%20do%20not%20support%20this%20operation%2C%20but%20I%20have%20forwarded%20your%20suggestion%20to%20our%20GUI%20GUIDER%20team.%20We%20will%20address%20this%20issue%20in%20future%20versions.%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20understanding.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E