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

Quotations marks in text for a change #48

Open
felixwiemuth opened this issue Jan 2, 2018 · 4 comments
Open

Quotations marks in text for a change #48

felixwiemuth opened this issue Jan 2, 2018 · 4 comments

Comments

@felixwiemuth
Copy link

felixwiemuth commented Jan 2, 2018

In the <change> tags, using quotation marks as " or escaped as \" or even as \u0022 does not show the symbol in the dialog, there is no character instead. In Android resources this works (e.g. in strings.xml). Single quotes ' even cause the whole text following to be removed.

Using the actual characters „ “ ” ‚ ‘ ’ works, however.

@cketti
Copy link
Owner

cketti commented Jan 3, 2018

Works for me. Can you provide a changelog file that demonstrates the issue?

@felixwiemuth
Copy link
Author

Sure, here is one with screenshot of what I see (on Android 7.1.2 (LineageOS 14.1-20171214-NIGHTLY-klte), minSdkVersion 16, targetSDKVersion 26).
changelog_master.xml.txt (.txt only for uploading here)
screenshot_20180103-124404

@cketti
Copy link
Owner

cketti commented Jan 3, 2018

Looks like this works fine with AAPT, but is an issue when using AAPT2. Using &quot; to XML-encode double quotes doesn't work either. Presumably because AAPT2 decodes that when parsing the XML file for generating the resource file.

The contents of the <change> elements are added as-is to the generated HTML used for displaying the dialog. So as a workaround you could use HTML-encoded double quotes in your change entries. Because everything is an XML file you'll have to additionally XML-encode them. Doing that we'll end up with:

<release version="2.2" versioncode="13" >
    <change>&amp;quot;Normal quotes&amp;quot;</change>
    <change>“unicode quotes”</change>
    <change>&amp;apos;Single quotes&amp;apos;</change>
    <change>‘Unicode single quotes’</change>
</release>

Alternatively, you could disable aapt2 as described here: https://developer.android.com/studio/build/gradle-plugin-3-0-0.html

Issue in Google's bug tracker: https://issuetracker.google.com/issues/71805084

@felixwiemuth
Copy link
Author

Okay, thanks for the quick investigation. Probably using the proper unicode symbols for quotes doesn't hurt either ;).

But why does it work in strings.xml then? Shouldn't that be compiled with the same tool?

Anyway, just make sure to note it in your documentation if the problem cannot be solved.

cketti added a commit to thunderbird/thunderbird-android that referenced this issue Feb 24, 2018
cketti added a commit that referenced this issue May 13, 2018
This is mostly due to AAPT(2) optimizing files in res/xml/ and there's
no guarantee this won't break our files. Sadly, there has been at least
one bug that affected ckChangeLog. See issue #48.
@cketti cketti mentioned this issue May 13, 2018
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

2 participants