Re: [xml] Read&Write Files with unicode/UTF-16 names (on Windows) (was: RE: Read tree from FILE* ?)



Trappel Martin wrote:
-----Original Message-----
From: Rob Richards [mailto:rrichards ctindustries net] 
Sent: Monday, April 23, 2007 2:23 PM
To: Trappel Martin
Cc: xml gnome org
Subject: Re: [xml] Read&Write Files with unicode/UTF-16 names 
(on Windows) (was: RE: Read tree from FILE* ?)

Trappel Martin wrote:
    
Still, allow me to phrase two questions:
* Is there an opposite to xmlReadIO, something like xmlWriteIO ?
  
      
maybe xmlSaveToIO
    
* Is anyone using the xmlRegisterInputCallbacks(..) to open 
      
files with 
    
wide character names? (It seems to me this would require some 
additional wrapping, since the callback functions get char* for the 
file URL. So I'd first had to encode the wchar_t filename 
      
to utf8 and 
    
the, in the callback, decode it again.)
  
      
You should encode the filenames to UTF-8 before passing them. 
Unless you have any other requirements, you shouldn't need 
custom I/O handlers. As of 2.6.24, under windows, the io 
handlers will first attempt to convert the path from utf-8 to 
wide chars and use the _wxxxx functions to stat and open. If 
you need to support prior versions, you can always use the 
code within xmlIO.c to write your own handlers.

    

Thanks a lot! This is fantabulous news :-)

( Is this mentioned anywhere in the docs? Did I look in the wrong places for
this info? )
  
I really don't know if it was added to the docs. Just remember this had
been brought up sometime last year and checked the release info:
http://xmlsoft.org/news.html.

Rob



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