You've already forked lazarus-ccr
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user