mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
defined StringFromXMLString
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34489 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8eadbe4163
commit
d9db64516a
2 changed files with 12 additions and 1 deletions
|
@ -351,7 +351,7 @@ GS_PRIVATE_INTERNAL(NSXMLDocument)
|
||||||
|
|
||||||
if (buf != 0 && length > 0)
|
if (buf != 0 && length > 0)
|
||||||
{
|
{
|
||||||
string = UTF8StrLen(buf, length);
|
string = StringFromXMLString(buf, length);
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
|
|
|
@ -39,9 +39,20 @@
|
||||||
*/
|
*/
|
||||||
#define XMLSTRING(X) ((const unsigned char*)[X UTF8String])
|
#define XMLSTRING(X) ((const unsigned char*)[X UTF8String])
|
||||||
|
|
||||||
|
inline static NSString*
|
||||||
|
StringFromXMLString(const unsigned char *bytes, unsigned length)
|
||||||
|
{
|
||||||
|
NSString *str;
|
||||||
|
|
||||||
|
str = [[NSString alloc] initWithBytes: bytes
|
||||||
|
length: length
|
||||||
|
encoding: NSUTF8StringEncoding];
|
||||||
|
return AUTORELEASE(str);
|
||||||
|
}
|
||||||
|
|
||||||
#define MY_DOC ((xmlDoc *)internal->node)
|
#define MY_DOC ((xmlDoc *)internal->node)
|
||||||
|
|
||||||
|
|
||||||
/* Instance variables for NSXMLNode. This macro needs to be defined before
|
/* Instance variables for NSXMLNode. This macro needs to be defined before
|
||||||
* the NSXMLNode.h header is imported and before GSInternal.h is imported.
|
* the NSXMLNode.h header is imported and before GSInternal.h is imported.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue