Bug 319135 - Umlauts in Category names are not handled correctly
Summary: Umlauts in Category names are not handled correctly
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: XML backend (show other bugs)
Version: GIT master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 21:42 UTC by Johannes Zarl-Zierl
Modified: 2013-04-30 23:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Stacktrace when opening a database with subcategories in an umlaut-category (1.41 KB, text/plain)
2013-04-30 22:15 UTC, Johannes Zarl-Zierl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Zarl-Zierl 2013-04-30 21:42:37 UTC
When creating categories with umlauts, after saving umlauts are mangled in the resulting index.xml file.

Steps to reproduce:
1) start kphotoalbum --demo
2) Settings -> configure KPA... -> Categories -> new Category "Ü"
3) Save Database and exit KPA
=> the index.xml file contains "_.FFFFFFDC" instead of "Ü"
4) Reopen KPA
=> The new category is displayed as "ÿFFFFDC"

Optional:
5) Save database again and exit KPA
=> the index.xml contains "_.FFFFFFFFFFFFDC"
6) Reopen KPA
=> the category is displayed as "ÿFFFFFFFFFFDC"
Comment 1 Manfred Usselmann 2013-04-30 22:03:32 UTC
In addition, when categories are grouped the index.xml can not be opened any longer, because in the group definition at the end of the file the umlauts are not replaced.

Example:

At the beginning:
<Category name="Schl_.FFFFFFFCsselbegriffe"> 

At the end:
 <member-groups><member category="Schlüsselbegriffe"
 
To open the file everything needs to be renamed to "Schlüsselbegriffe", but when it's saved again, the same situation occurs, the category name is changed back to Schl_.FFFFFFFCsselbegriffe.
Comment 2 Johannes Zarl-Zierl 2013-04-30 22:15:19 UTC
Created attachment 79579 [details]
Stacktrace when opening a database with subcategories in an umlaut-category

Adding a member category to a category with an umlaut, KPA crashes when reopening the saved database.
Comment 3 Johannes Zarl-Zierl 2013-04-30 23:22:05 UTC
Git commit 2abcb1cbe6a5a2d6b8d9da1344bd80dcf1f550b6 by Johannes Zarl.
Committed on 01/05/2013 at 00:58.
Pushed by johanneszarl into branch 'master'.

Fix crash when member group category doesn't exist.

When the category of the member-group does not exist, a warning is
printed on the console and a matching category is created.

M  +7    -0    XMLDB/FileReader.cpp

http://commits.kde.org/kphotoalbum/2abcb1cbe6a5a2d6b8d9da1344bd80dcf1f550b6
Comment 4 Johannes Zarl-Zierl 2013-04-30 23:22:06 UTC
Git commit 55340bc57cb49cf2ca529f1fede80ce178bdfd90 by Johannes Zarl.
Committed on 01/05/2013 at 01:20.
Pushed by johanneszarl into branch 'master'.

Don't escape strings for xml attribute values.

M  +6    -2    XMLDB/FileWriter.cpp

http://commits.kde.org/kphotoalbum/55340bc57cb49cf2ca529f1fede80ce178bdfd90