Options

Special character when reading data from file .sdf

giovannixyzgiovannixyz Member Posts: 13
edited 2010-07-30 in Navision Attain
Hi, In our navision we have custom program, wich can read data from .sdf file.

I create this file in SQL and safe on disk. navision read it, by clicking it.
problem is, because special charasters like 'č,ć,š' in navision don`t show.

any idea, how to solve this?
in global special character works, but here not.

Comments

  • Options
    mrsamrsa Member Posts: 35
    It is codepage problem.

    I have this two function to convert special characters from NAV to file, and from file to NAV.
    But it works in Croatia.

    Best way to do is to save file from SQL with one string conatining special characters ČŠĐŽ...
    ŽImport it and then you parse it to int like:

    i ineteger

    i:=incomeText[1]; //supose first leter is Č

    MESSAGE('%1',i); Then you know that char code you must replace with Č



    My funtioncs:

    FromFileToNAV(inText : Text[500]) outText : Text[500]
    NasiZnaci[1]:=138; //equals to Š in from file
    NasiZnaci[2]:=208; // equals to Đ in from file
    NasiZnaci[3]:=200; //...
    NasiZnaci[4]:=198;
    NasiZnaci[5]:=142;
    NasiZnaci[6]:=154;
    NasiZnaci[7]:=240;
    NasiZnaci[8]:=232;
    NasiZnaci[9]:=230;
    NasiZnaci[10]:=158;
    outText:=CONVERTSTR(inText,NasiZnaci,'ŠĐČĆŽšđčćž');


    second function:

    FromNAVtoFile(inText : Text[500]) outText : Text[500]
    NasiZnaci[1]:=138;
    NasiZnaci[2]:=208;
    NasiZnaci[3]:=200;
    NasiZnaci[4]:=198;
    NasiZnaci[5]:=142;
    NasiZnaci[6]:=154;
    NasiZnaci[7]:=240;
    NasiZnaci[8]:=232;
    NasiZnaci[9]:=230;
    NasiZnaci[10]:=158;
    outText:=CONVERTSTR(inText,'ŠĐČĆŽšđčćž',NasiZnaci);
  • Options
    giovannixyzgiovannixyz Member Posts: 13
    But the problem is, because Navision read withouth Č.Š,Ž

    I try to replace this in SQL with ( [ { and in navi back again to ČšŽ with

    string_opomba := CONVERTSTR(string_opomba, '[', 'č');

    but now I got z and Ž, s Š ... mixed up. any idea?
  • Options
    mrsamrsa Member Posts: 35
    I also found on problem where inbound files where in unicode format, where spectial charters where compaund of 2 bytes, then you must parse stirng by 2 to 2 bytes and try to find combinations. If you could uplad file maybe i can help.
Sign In or Register to comment.