Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Japanese characters are not displayed in webvisu

2021-03-23
2021-03-25
  • andreas-kleiner

    andreas-kleiner - 2021-03-23

    Good morning everyone
    I have an issue with displaying japanese characters in the web visu.
    May someone give me a hint what to do?

    I have a translated textlist (see attachment). I can download it (no errors) but it displays only question marks (???)
    It appears the same way on all devices, on our web panel at the machine, over a web browser from my laptop or from a mobile device.

    All other language changes work.

    Thanks for your help.

    Best regards
    Andreas

     
  • m.prestel

    m.prestel - 2021-03-23

    You have to use wstrings if you want to display non ASCII characters.

    Best regards,
    Marcel

     
  • andreas-kleiner

    andreas-kleiner - 2021-03-23

    Thank you Marcel
    Thats quite a huge change in the program.
    I have to replace all the strings.
    Thanks for your help
    Andreas

     
  • andreas-kleiner

    andreas-kleiner - 2021-03-25

    I am still struggeling with this japanese characters.

    I changed the data type of the "name* in my structure from string to wstring, i declared ws_text as a wstring as well and
    I want to read the textlist with the function "DynamicTextGetTextW". Now it says that the a "string" cannot be converted to
    a wstring.
    Obviously the return value of this function "DynamicTextGetTextW is always a string and it will display
    the wrong codes in my table.

            FOR i_count10 := i_count1_start TO i_count1_start+i_stepSize DO
                sTextListID := INT_TO_STRING(i_count10);
                ws_Text:=(VisuElems.cmpDynamictext.DynamicTextGetTextW(ADR(sTextList), ADR(sTextListID))^);
    
                stScaleParameter[i_count10].Name:=ws_Text;
                stScaleParameter[i_count10].Index := i_count10;
            END_FOR
    

    Is there another way to read these Japanese characters and display it correctly in the table?
    All other texts, that are not part of this structure are displayed correctly (in Japanese)
    Your help is much appreciated. I am new to this field and not well experienced.

    Best regards
    Andreas

     
  • m.prestel

    m.prestel - 2021-03-25

    Since it is a pointer, just assign the result of DynamicTextGetTextW to a POINTER OF WSTRING and after that deference it.

    Best regards,
    Marcel

     
  • andreas-kleiner

    andreas-kleiner - 2021-03-25

    Thats it, thank you very much!
    I would have bought you a beer if you were around

    Best regards
    Andreas

     

Log in to post a comment.