Manage special characters in a dataport

ams79ams79 Member Posts: 39
Hello everyone,

Do you have any way to manage efficiently special characters in a dataport?

characters like ñ,ó,Ñ,ã,ª, etc

Thanks!!

Comments

  • Timo_LässerTimo_Lässer Member Posts: 481
    Have a look at this download:

    Ansi-Ascii converter
    Convert ANSI characters to ASCII and back!
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Sometimes, the dataport does not pick up wierd characters. For example, I recently dealt with a dataset that had carriage returns. How do you DELCHR a carriage return?
  • krikikriki Member, Moderator Posts: 9,112
    Alex Chow wrote:
    Sometimes, the dataport does not pick up wierd characters. For example, I recently dealt with a dataset that had carriage returns. How do you DELCHR a carriage return?
    Try this:

    txtCR text:30
    txtCR := 'X';
    txtCR[1] := 13;
    
    txtTheText := DELCHR(txtTheText,'=',txtCR);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • MalajloMalajlo Member Posts: 294
    ASCII2ANSI does not work for all codepages, i.e. Slovenian :(
    I solved problem importing all special characters in a table, determining and inserting ASCII no. to it.
    This way I found real ASCII code and then I could convertstr properly.
    SpecCode - OnBeforeEvaluateField(VAR Text : Text[1024])
    EVALUATE(charact,COPYSTR(Text,1,1)) ;
    chrss := charact ;
    

    Using variables
    charact Char
    chrss Integer
    SpecChars- OnAfterImportRecord()
    Chrs := chrss ;
    

    And inserting in to table SpecChars
    SpecCode Text 30
    Chrs Integer


    (var names are not quite recognizable so excuse me...)
  • Alex_ChowAlex_Chow Member Posts: 5,063
    kriki wrote:
    Try this:

    txtCR text:30
    txtCR := 'X';
    txtCR[1] := 13;
    
    txtTheText := DELCHR(txtTheText,'=',txtCR);
    

    What the hell? :shock:

    I didn't think this code would compile much less work. How the heck could you have possibly figure out using txtCR using the same syntax as an array without declaring the variable as an array?

    Are you Navision dressed up as a human or something?
  • jlandeenjlandeen Member Posts: 524
    nice to see that even some of you veteran posters here can learn a few new things ;)
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • NaviDevNaviDev Member Posts: 365
    jlandeen wrote:
    nice to see that even some of you veteran posters here can learn a few new things ;)

    Thats how life is running... existed in the world, learn things you didnt know, pass it through those who does not yet know and die in the end :mrgreen:
    Navision noob....
  • krikikriki Member, Moderator Posts: 9,112
    Alex Chow wrote:
    kriki wrote:
    Try this:

    txtCR text:30
    txtCR := 'X';
    txtCR[1] := 13;
    
    txtTheText := DELCHR(txtTheText,'=',txtCR);
    

    What the hell? :shock:

    I didn't think this code would compile much less work. How the heck could you have possibly figure out using txtCR using the same syntax as an array without declaring the variable as an array?

    Are you Navision dressed up as a human or something?
    You just blew my secret identity! :x

    Just kidding :lol:

    I wondered at a certain point about texts. A string (or text) is an array of char, so I just tried the array-logic on it.
    The initialization is needed to define the length of the string, otherwise it will be garbage.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Alex_ChowAlex_Chow Member Posts: 5,063
    Bravo! =D> You're the man.
    nice to see that even some of you veteran posters here can learn a few new things

    Yes, learning something new and be amazed by it is one of the pleasures of life.
  • patadeperropatadeperro Member Posts: 2
    The solution still saves the day for some of us!! =D>
Sign In or Register to comment.