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


 in XML attributes #185

Closed
owenzhao opened this issue May 31, 2020 · 1 comment · Fixed by #188
Closed


 in XML attributes #185

owenzhao opened this issue May 31, 2020 · 1 comment · Fixed by #188
Labels
enhancement New feature or request

Comments

@owenzhao
Copy link
Collaborator

owenzhao commented May 31, 2020

In xliff exported by Xcode, 
 is a replacement for \n. However, when decoded and encoded by XMLCoder, the 
 is replaced by a hard line break

original by Xcode

<trans-unit id="Got an attributed String.&#10;Will create a image.&#10;&#10;" xml:space="preserve">

decoded and encoded by XMLEncoder

<trans-unit id="Got an attributed String.
Will create a image.

" xml:space="preserve">

However, the latter is then not accepted by Xcode as a valid translation.

My Question

Should I think this as a bug of XMLCoder or something that I should deal with in my own app?

@MaxDesiatov MaxDesiatov added the enhancement New feature or request label May 31, 2020
MaxDesiatov added a commit that referenced this issue Jun 1, 2020
Resolve #185.
Resolve #187.

Add new `charactersEscapedInAttributes` and `charactersEscapedInElements` properties on `XMLEncoder` that allow customizing how certain characters are escaped.
@MaxDesiatov
Copy link
Collaborator

Hi @owenzhao, thanks for reporting this. With the new API in master you can do something like encoder.charactersEscapedInAttributes += [("\n", "&#10;")] to make it work for your case.

arjungupta0107 pushed a commit to salido/XMLCoder that referenced this issue Jun 26, 2020
Resolve CoreOffice#185.
Resolve CoreOffice#187.

Add new `charactersEscapedInAttributes` and `charactersEscapedInElements` properties on `XMLEncoder` that allow customizing how certain characters are escaped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants