Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDXMLNode:XMLString can't handle unicode #36

Closed
qiulang opened this issue Jan 14, 2014 · 3 comments
Closed

DDXMLNode:XMLString can't handle unicode #36

qiulang opened this issue Jan 14, 2014 · 3 comments

Comments

@qiulang
Copy link

qiulang commented Jan 14, 2014

Hi I find that DDXMLNode:XMLString can't handle unicode case, it will return string with unicode point &#x...

Just check this simple case,

DDXMLNode *node = [DDXMLNode attributeWithName:@"name" stringValue:@"我"];
NSLog(@"%@",[node XMLString]);

The output is "name="& # x6211;" // I have to add some space in between here otherwise my browser will convert to the corresponding unicode character

I have check the code but but have no idea how to fix it.

@AtemTeng
Copy link

+1,how to solve?

@Feng999
Copy link

Feng999 commented Nov 17, 2016

+1, any idea?

@colemancda
Copy link
Contributor

Same here:

DDXMLElement *element = [DDXMLElement elementWithName:@"testElement" stringValue:@"😎"];
NSLog(@"%@", element.description);
[element addAttribute:[DDXMLNode attributeWithName:@"testAttribute" stringValue:@"😎"]];
NSLog(@"%@", element.description);

Produces:

<testElement>😎</testElement>
<testElement testAttribute="&#x1F60E;">😎</testElement>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants