Importing ANSI characters

zaczac Member Posts: 29
Hi everyone.
I use dataport to put some new records in the table and I have a problem with ANSI chars. For example, in my file which I try to import is the word CITROËN. After importing in a table filed stands CITRO—N. If I directly copy this word from file to table stands CITROËN. Can someone explain to me why it's happend and if have solution form my issue.
I've tried to use EncodingConverter but no help.
Thanks

Answers

  • garakgarak Member Posts: 3,263
    PROCEDURE Ansi2Ascii@10(_String@1150001 : Text[250]) _Output@1150000 : Text[250];
        BEGIN
          // Converts from ANSI to ASCII
          EXIT(CONVERTSTR(_String,'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÀÊËÈÍÎÏÌÓßÔÒÚÛÙ',
                                  '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©µ¶·ÒÓÔÖ×ØÞàáâãéêë'));
        END;
    
        PROCEDURE Ascii2Ansi@1150001(_String@1150001 : Text[1024]) @1150000 : Text[1024];
        BEGIN
          // Converts from ASCII to ANSI
          EXIT(CONVERTSTR(_String,'€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©µ¶·ÒÓÔÖ×ØÞàáâãéêë',
                                  'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÀÊËÈÍÎÏÌÓßÔÒÚÛÙ'));
        END;
    

    Regards
    Do you make it right, it works too!
  • ajhvdbajhvdb Member Posts: 672
    @garak, if I copy your example code. Will it be converted to different chars if i use ctrl-c in this post and ctrl-v in NAV?
  • zaczac Member Posts: 29
    Tnx garak
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,499
    [The use of [SOLVED] in the Topic Title is no longer supported. Please edit the first message in the thread and use the field Attribute (below the Subject-field) to put a green checkmark next to the Topic Title. And remove the [SOLVED] text in the Topic Title]
  • ajhvdbajhvdb Member Posts: 672
    garak wrote:
    PROCEDURE Ansi2Ascii@10(_String@1150001 : Text[250]) _Output@1150000 : Text[250];
        BEGIN
          // Converts from ANSI to ASCII
          EXIT(CONVERTSTR(_String,'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÀÊËÈÍÎÏÌÓßÔÒÚÛÙ',
                                  '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©µ¶·ÒÓÔÖ×ØÞàáâãéêë'));
        END;
    
        PROCEDURE Ascii2Ansi@1150001(_String@1150001 : Text[1024]) @1150000 : Text[1024];
        BEGIN
          // Converts from ASCII to ANSI
          EXIT(CONVERTSTR(_String,'€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©µ¶·ÒÓÔÖ×ØÞàáâãéêë',
                                  'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®ÁÀÊËÈÍÎÏÌÓßÔÒÚÛÙ'));
        END;
    

    Regards

    Hi Garak,

    Do you have these functions in a fob file. I can't seem to use ctrl-v, ctrl-v.
  • SavatageSavatage Member Posts: 7,142
    Me too - When I copy & Paste alot of the characters are just little black squares
  • garakgarak Member Posts: 3,263
    i put it in a fob @monday. Then i'm back in my office and can work \:D/ (after the ~2 weeks in the hospital :( )
    Do you make it right, it works too!
  • ajhvdbajhvdb Member Posts: 672
    @garak, didn't see this post before. All the best and take your time to get better.
  • garakgarak Member Posts: 3,263
    Sorry for the late response.
    I've uploaded it in the download section. It must be availeble in some hours.

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.