Re: [xml] The issue around LoadLibrary on Windows

On 23.05.2012 15:07, Nikolay Sivov wrote:

On 5/23/2012 14:44, Ralf Junker wrote:
On 23.05.2012 14:26, Nikolay Sivov wrote:

It's not a question how to use MultiByteToWideChar() to do UTF-8 ->
WCHAR, the question is does 'name' argument is UTF-8 string or not.
By the way, is dlopen() supposed to work on UTF-8 input? I doubt so,
and since xmlModuleOpen() has ifdef-ed version for each platform, it
makes me think that LoadLibraryA is a valid solution.
Daniel mentioned xmlChar* in his original message and, AFAIK, xmlChar*
is supposed to hold UTF-8 strings just as libxml uses UTF-8 internally.

If this is true, neither LoadLibraryA nor LoadLibraryW work for any
characters outside the ASCII range.
How it's possible to use utf-8 for xmlModulePlatrfomOpen() as long as it
ends up
calling dlopen() or shl_load() for example?

For Windows, xmlModulePlatformOpen() does not call dlopen() or
shl_load(). It only calls LoadLibrary().

xmlModulePlatrfomOpen() is called by xmlModuleOpen(). Both use char*.

xmlModuleOpen() is called by xsltExtModuleRegisterDynamic(), which
builds the char* filename by prinft'ing and casting two xmlChar* strings.

The goal is to resolve windows build issue, not to change the way it
works on other platforms
by changing interface to utf-8 file names.

Fine with me. As long as it works on Windows. Currently it does not, for
the reasons pointed out.

I see that xsltExtModuleRegisterDynamic(const xmlChar * URI) uses
xmlChar so I suppose this is UTF-8. At last it calls
xmlModulePlatformOpen() but does not apply character conversion. To me
this seems inconsistent.
Well, this is irrelevant to initial problem, looks inconsistent, that's
right - and should be addressed
separately in libxslt.

Initial problem or separate issue - for me, both seem closely related to
take them into consideration at once.

I do not have a general solution, just a Windows view on the problem.
This is what Daniel asked for. Hope I could help.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]