[mapguide-users] WHat version of FDO is MapGuide 3.1.1 compiled against?

Hans Milling hm at geograf.dk
Wed Apr 18 01:48:40 PDT 2018


Hi

I am trying to implement the fix for MapInfo TAB files that always uses
Windows 1252 and not UTF-8.
The OGR provider always assumes that files are UTF-8 and letters like é, æ
or ß turn out as chinese characters.
I have done this fixto MapGuide 2.2, 2.4, 2.6 and  3.1. This time for the
3.1.1 release the compiled DLL does not work. The OGRProvider.dll in the
MapGuide\Server\Fdo folder states version 4.1. But when I compile my own 4.1
OGRProvider.dll it cannot be loaded. The error is:
Unable to load the FDO Provider library '.\OGRProvider.dll': The specified
module could not be found. (Cause: , Root Cause: Unable to load the FDO
Provider library '.\OGRProvider.dll': The specified module could not be
found. ) 

Not many details there.
Is MapGuide 3.1.1 build against FDO trunk, or some other branch that is
still version 4.1?

This is the original post about the problem:
http://osgeo-org.1560.x6.nabble.com/FDO-OGR-3-6-3-7-and-UTF-8-problem-td3898674.html

This is my first follow up post:
http://osgeo-org.1560.x6.nabble.com/FDO-OGR-4-1-still-has-problems-with-Latin1-ISO-8859-1-when-using-MapInfo-TAB-td5289710.html#a5289983

Perhaps someone with the right build environment could compile the change
for me ;-)

in
Providers\OGR\Src\Provider\stdafx.h add this function:
static std::wstring A2W_SLOW_ASCII(const char* input)
{
	int wlen = (int)strlen(input) + 1;
	wchar_t* ws = (wchar_t*)alloca(sizeof(wchar_t)*wlen);
	MultiByteToWideChar(CP_ACP, 0, input, -1, ws, wlen);
	return std::wstring(ws);
}

in
Providers\OGR\Src\Provider\OgrProvider.cpp
change
	m_sprops[(long)val] = A2W_SLOW(val);
to
	m_sprops[(long)val] = A2W_SLOW_ASCII(val);

That is it. Only downside is that all files read by the OGR provider is
treated as ASCII/Windows 1252.

A perfect implementation would be something like
if (source_file_is_mapinfo_tab_or_mif)
	m_sprops[(long)val] = A2W_SLOW(val);
else
	m_sprops[(long)val] = A2W_SLOW_ASCII(val);

But I have no idea how to implement this.

Best Regards
  Hans Milling



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list