Closed miklosbagi closed 3 years ago
Attempted a fix but got stuck, Halp! :)
Adding a simple HTML decoder helps: AlbumTableViewCell.m line 61
from:
else {
self.albumComment.text = self.albumData.comment;
self.albumComment.textColor = [UIColor piwigoColorText];
}
to:
else {
NSData* stringData = [self.albumData.comment dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* options = @{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType};
NSAttributedString* decodedAttributedString = [[NSAttributedString alloc] initWithData:stringData options:options documentAttributes:NULL error:NULL];
NSString* decodedString = [decodedAttributedString string];
self.albumComment.text = decodedString;
self.albumComment.textColor = [UIColor piwigoColorText];
}
This seems to fix the iOS bit of the issue, well, somewhat. Please note the "ő" character at the end of the second line in the comment (screenshot in bug description). That character is not HTML encoded, so decoding with the above method will actually lead to breaking that.
JSON received for the album in question from /ws.php?format=json&method=pwg.categories.getList looks like:
{
"id": 31,
"name": "Események",
"comment": "\r\n\tÜnnepek, ballagások, szallagavatók, esküvők, tejfakasztók, és temetések\r\n",
"permalink": null,
...
This is with content type text/plain; charset=utf-8
.
So the question is:
Duplicate issue. See #324.
Describe the bug and how to reproduce Using special characters in Album description breaks the user experience in the mobile app as they don't they HTML decoded.
Steps to reproduce the behavior:
Expected behavior Enable HTML decode to album descriptions.
Screenshots
Smartphone (please complete the following information):
Additional details Please note that the same behavior is observable when viewing the Album title on the Album view screen.