Options

Speciall Characters in dynamics nav

amaro88amaro88 Member Posts: 2
Hi,

I have a problem when I try to use this simbol: "š". When I save the codeunit and I run it, the message shows "s". I think, there is a problem with characters coding, but I don't know how to solve it. I tried to use the char: "U + 0161", but it shows "i", instead of "š".

Thank you.

Answers

  • Options
    AquirAquir Member Posts: 23
    edited 2016-09-21
    yes because the development environment is not Unicode but the Windows Client is Unicode
    1. Find the right Decimal Code for your strange character
    2. Create a Char variable and assign the Decimal code for it
    Standard NAV code example from NAV 2017
    ResolveCurrencySymbol(CurrencyCode : Code[10]) : Text[10]
    IF Currency.GET(CurrencyCode) THEN
      IF Currency.Symbol <> '' THEN
        EXIT(Currency.Symbol);
    
    PoundChar := 163;
    YenChar := 165;
    EuroChar := 8364;
    
    CASE CurrencyCode OF
      'AUD','BND','CAD','FJD','HKD','MXN','NZD','SBD','SGD','USD':
        EXIT('$');
      'GBP':
        EXIT(FORMAT(PoundChar));
      'DKK','ISK','NOK','SEK':
        EXIT('kr');
      'EUR':
        EXIT(FORMAT(EuroChar));
      'CNY','JPY':
        EXIT(FORMAT(YenChar));
    END;
    
    3. Use the Character with FORMAT (see in the example)
Sign In or Register to comment.