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:
parent
00dfa0a45e
commit
a788601c66
@ -77,6 +77,9 @@
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
|
@ -26,7 +26,6 @@ object MainForm: TMainForm
|
||||
Font.Color = clBlack
|
||||
MapProvider = 'OpenStreetMap Mapnik'
|
||||
POIImages = POIImages
|
||||
POIImagesWidth = 0
|
||||
UseThreads = True
|
||||
ZoomToCursor = False
|
||||
OnZoomChange = MapViewZoomChange
|
||||
@ -40,9 +39,9 @@ object MainForm: TMainForm
|
||||
Height = 640
|
||||
Top = 0
|
||||
Width = 275
|
||||
ActivePage = PgConfig
|
||||
ActivePage = PgData
|
||||
Align = alRight
|
||||
TabIndex = 1
|
||||
TabIndex = 0
|
||||
TabOrder = 1
|
||||
object PgData: TTabSheet
|
||||
Caption = 'Data'
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user