locked
non-english characters in external js file. RRS feed

  • Question

  • here is the deal:

    There's a grid level button in custom entity.

    ISV customization file looks like this:

    <Entity name="my_customEntity">
    
       <Grid>
    
          <MenuBar>
    
             <Buttons>
    
                <Button Icon="/_imgs/ico_16_customEntity_d.gif" JavaScript="...">
    
                   <Titles>
    
                      <Title LCID="1033" Text="Atlikti veiksmą" />
    
                   </Titles>
    
                   <ToolTips>
    
                      <ToolTip LCID="1033" Text="Pilnas atlikti veiksmą aprašymas" />
    
                   </ToolTips>
    
                </Button>
    
             </Buttons>
    
          </MenuBar>
    
       </Grid>
    
    </Entity>
    
    

     

    and JavaScript:

    var script = document.createElement('script');
    
    script.charset = 'utf-8';
    
    script.language = 'javascript';
    
    script.src = '/ISV/my_script.js';
    
    script.onreadystatechange = OnScriptReadyState;
    
    document.getElementsByTagName('head')[0].appendChild(script);
    
    function OnScriptReadyState() 
    
    { 
    
       if (event.srcElement.readyState == 'complete')
    
       { 
    
          myFunction(getSelected('crmGrid'));
    
       }
    
    } 
    
    

    In 'my_script.js' file there are couple alert() lines with lithuanian chars like ąčęėįšųūž.
    During script runtime, alert's do not show those chars, I get "squares" instead.
    But all strings, that came from RetrieveMultiple are shown right (with ąčęėįšųūž).
    If I try debugging, even in commened area all lithuanian chars are gone.
    There is no problem, if alert() comes from ISV.config file, not external one.

    So the question is, how to make lithuanian chars work using external js file?

    Maybe some of you know a solution, or have any ideas, how to solve this.
    I need Your help.
    Thanks in advance.

    Linas

    Tuesday, April 13, 2010 6:04 AM

Answers

  • Problem solved.
    js file should have been saved using "UTF-8 encoding".

    Such a small thing took me quite long time to find/figure out.

    Also, thank you, Mahender Pal, for trying to help me.

    • Marked as answer by fLn Tuesday, April 13, 2010 6:48 AM
    Tuesday, April 13, 2010 6:47 AM

All replies

  • Hi,

    For that you have to install lithuanian language pack, it hope it will solve your problem.

     

     


    Mahain
    Tuesday, April 13, 2010 6:22 AM
    Moderator
  • Problem solved.
    js file should have been saved using "UTF-8 encoding".

    Such a small thing took me quite long time to find/figure out.

    Also, thank you, Mahender Pal, for trying to help me.

    • Marked as answer by fLn Tuesday, April 13, 2010 6:48 AM
    Tuesday, April 13, 2010 6:47 AM