lazmapviewer: Fix usage of UTF-8 in search function. SourceForge issue #52, patch by Manhisz Vanna

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8200 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-02-25 21:25:02 +00:00
parent 00dfa0a45e
commit a788601c66
3 changed files with 6 additions and 19 deletions

View File

@ -68,21 +68,6 @@ const
SEARCH_URL = 'http://geonames.org/search.html?q=%s'; //&country=%s';
function CleanLocationName(x: string): string;
var
i: Integer;
begin
Result := '';
for i := 1 to Length(x) do
begin
if x[i] in ['A'..'Z', 'a'..'z', '0'..'9'] then
Result := Result + x[i]
else
Result := Result + '+'
end;
end;
{ TMVGeoNames }
procedure TMvGeoNames.FoundTagHandler(NoCaseTag, ActualTag: String);
@ -219,7 +204,7 @@ begin
FLocationName := ALocationName;
ms := TMemoryStream.Create;
try
url := Format(SEARCH_URL, [CleanLocationName(FLocationName)]);
url := Format(SEARCH_URL, [FLocationName]);
ADownloadEngine.DownloadFile(url, ms);
ms.Position := 0;
SetLength(s, ms.Size);