Přejít na obsah


Fotka

Geoget -> iGo8 v Unicode


  • Pokud chcete vložit odpověď, přihlašte se
24 odpovědí na toto téma

#21 pozorjed

pozorjed

    Advanced Member

  • Members
  • PipPipPip
  • 670 příspěvků(y)

Publikováno 26 srpen 2008 - 18:15

už jsem asi našel poslední chybu function ExportHeader: string; begin Result := UnicodeBOM('UCS-2'); end; vrací (hexadecimálně) FE FF 00 , ale iGo8 očekává jako počáteční znaky, FF FE (jen 2B). Ještě že mám ten UltraEdit, ve kterém to jde porovnat a spravit. jinak jsem si dnes neodpustil FTF na GC1F6YH, kupodivu to bylo lehčí než se prokousat zdrojovým kódem skriptu :( Je nějaká fce, která mi umožní zapsat jeden byte dle hexa hodnoty?, něco jako Char(FF) + Char(FE) ?
  • 0

#22 HaLuMa

HaLuMa

    Autor Geogetu

  • Members
  • PipPipPip
  • 14 515 příspěvků(y)

Publikováno 26 srpen 2008 - 18:50

pozorjed napsal/a:
function ExportHeader: string;
begin
Result := UnicodeBOM('UCS-2');
end;

vrací (hexadecimálně) FE FF 00 , ale iGo8 očekává jako počáteční znaky, FF FE (jen 2B).


Ta nula je az od dalsiho znaku. Ta funkce funguje spravne, problem je v tom, ze ty potrebujes kodovou stranku 'UCS-2LE', ktera ma presne obracene poradi bytu.

pozorjed napsal/a:
Je nějaká fce, která mi umožní zapsat jeden byte dle hexa hodnoty?, něco jako Char(FF) + Char(FE) ?


V tomto pripde je to zbytecne, staci kdyz budes vsude pouziva ten spravny nazev kodove stranky. Toje ostatne potreba pouzit i v tech prevodnich funkcich, jinak budes mit poradi bytu prohozene!

Nicmene abych odpovedel, zapsat muzes takhle:
Result := #$ff + #$FE;

  • 0

#23 pozorjed

pozorjed

    Advanced Member

  • Members
  • PipPipPip
  • 670 příspěvků(y)

Publikováno 26 srpen 2008 - 20:24

wau, moc děkuji, vypadá to mnohem lépe. ještě zbývá dodělat položku Country na 4 znaky, např. '_'+CZE a skript bude hotov. nynější polotovar var poradi: integer; var poradiWP: integer; var druhkesky: string; function ExportExtension: string; begin result := 'upoi'; end; function ExportDescription: string; begin result := 'iGo8 export verze 2'; end; function ExportHeader: string; begin Result := UnicodeBOM('UCS-2LE'); end; function ExportFooter: string; begin Result := UtfToCharset('', 'UCS-2LE'); end; function ExportPoint: string; var s: string; Num: string; n: integer; begin if poradi < 10 then poradi := 10; poradi := poradi + 1; if GC.CacheType='Traditional Cache' then druhkesky := 'community.police_station'; if GC.CacheType='Multi-cache' then druhkesky := 'Community.Prison'; if GC.CacheType='Unknown Cache' then druhkesky := 'community.college_university'; if GC.CacheType='Webcam Cache' then druhkesky := 'Tourist_Attractions.Winery'; if GC.CacheType='Event Cache' then druhkesky := 'Tourist_Attractions.Winery'; if GC.CacheType='Letterbox Hybrid' then druhkesky := 'Tourist_Attractions.Winery'; if GC.CacheType='Earthcache' then druhkesky := 'Community.Place_of_Worship'; if GC.CacheType='Virtual Cache' then druhkesky := 'Tourist_Attractions.Winery'; if GC.IsListed then begin //Export for Geocaches s := GC.ID; if length(GC.Lat) > 9 then GC.Lat := Copy(GC.Lat, 1, 9); if length(GC.Lat) = 8 then GC.Lat := GC.Lat + '0'; if length(GC.Lat) = 7 then GC.Lat := GC.Lat + '00'; if length(GC.Lat) = 6 then GC.Lat := GC.Lat + '000'; if length(GC.Lon) > 9 then GC.Lon := Copy(GC.Lon, 1, 9); if length(GC.Lon) = 8 then GC.Lon := GC.Lon + '0'; if length(GC.Lon) = 7 then GC.Lon := GC.Lon + '00'; if length(GC.Lon) = 6 then GC.Lon := GC.Lon + '000'; Num := IntToStr(Poradi); // Result := Result + Num + '|' + 'GC' + '|' + GC.ID + '|' + druhkesky + '|' + GC.Lat + '|' + GC.Lon + '|_' + GC.Country + '|||Temer nic|Nepojmenovana silnice|||' + CRLF; Result := Result + Num + '|' + 'GC' + '|' + GC.ID + '|' + druhkesky + '|' + GC.Lat + '|' + GC.Lon + '|_CZE|||Temer nic|Nepojmenovana silnice|||' + CRLF; //Export for Waypoints poradiWP := 0; s := ''; for n := 0 to GC.Waypoints.Count - 1 do if GC.Waypoints[n].IsListed then begin poradiWP := poradiWP + 1; s := GC.Waypoints[n].ID + 'W' + IntToStr(poradiWP); poradi := poradi + 1; Num := IntToStr(Poradi); if length(GC.WayPoints[n].Lat) > 9 then GC.WayPoints[n].Lat := Copy(GC.WayPoints[n].Lat, 1, 9); if length(GC.WayPoints[n].Lat) = 8 then GC.WayPoints[n].Lat := GC.WayPoints[n].Lat + '0'; if length(GC.WayPoints[n].Lat) = 7 then GC.WayPoints[n].Lat := GC.WayPoints[n].Lat + '00'; if length(GC.WayPoints[n].Lat) = 6 then GC.WayPoints[n].Lat := GC.WayPoints[n].Lat + '000'; if length(GC.WayPoints[n].Lon) > 9 then GC.WayPoints[n].Lon := Copy(GC.WayPoints[n].Lon, 1, 9); if length(GC.WayPoints[n].Lon) = 8 then GC.WayPoints[n].Lon := GC.WayPoints[n].Lon + '0'; if length(GC.WayPoints[n].Lon) = 7 then GC.WayPoints[n].Lon := GC.WayPoints[n].Lon + '00'; if length(GC.WayPoints[n].Lon) = 6 then GC.WayPoints[n].Lon := GC.WayPoints[n].Lon + '000'; Result := Result + Num + '|' + 'GcWp' + '|' + s + '|parking|' + GC.WayPoints[n].Lat + '|' + GC.WayPoints[n].Lon + '|_CZE|||Temer nic|Nepojmenovana silnice|||' + CRLF; end end else begin end Result := UtfToCharset(Result, 'UCS-2LE'); end;
  • 0

#24 HaLuMa

HaLuMa

    Autor Geogetu

  • Members
  • PipPipPip
  • 14 515 příspěvků(y)

Publikováno 26 srpen 2008 - 21:04

V ExportFooter ten prazdny retezec nemusis konvertovat. 'Nic' zkonvertovane do Unicode da stejne 'nic'. ;)
  • 0

#25 pozorjed

pozorjed

    Advanced Member

  • Members
  • PipPipPip
  • 670 příspěvků(y)

Publikováno 26 srpen 2008 - 21:06

díky z aradu, já jsem rád, že to nějak funguje, optimalizace bude až jako poslední krok :)
  • 0




0 uživatel(ů) prochází toto téma

0 uživatelů, 0 návštěvníků 0 anonymních uživatelů

Reklama