<table><tr><td style="">dvratil added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D3203" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>UTF-8 encoded text can only be present in iCal property values and not property names (otherwise it's not a valid iCal file and that's up to libical to deal with without crashing). libical itself does not attempt to parse unstructured property values (like Summary or Description), it just returns the string to the caller as a <tt style="background: #ebebeb; font-size: 13px;">char*</tt>. What KCalCore does is it calls <tt style="background: #ebebeb; font-size: 13px;">QString::fromUtf8()</tt> on this <tt style="background: #ebebeb; font-size: 13px;">char*</tt>, which internally calls <tt style="background: #ebebeb; font-size: 13px;">QUtf8::convertToUnicode()</tt>. <tt style="background: #ebebeb; font-size: 13px;">QTextStream</tt>, when used with the "UTF8" codec (i.e. <tt style="background: #ebebeb; font-size: 13px;">QUtf8Codec</tt>), internally uses the same method (<tt style="background: #ebebeb; font-size: 13px;">QUtf8::convertToUnicode()</tt>) to convert the text.</p>

<p>Therefore I don't think there's any benefit in running the entire iCal string through <tt style="background: #ebebeb; font-size: 13px;">QUtf8::convertToUnicode()</tt> if we then do it for each of the property values again when converting them to <tt style="background: #ebebeb; font-size: 13px;">QString</tt>. So +1 to David's patch, just re-add the <tt style="background: #ebebeb; font-size: 13px;">trimmed()</tt> call please.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R172 KCalendar Core</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3203" rel="noreferrer">https://phabricator.kde.org/D3203</a></div></div><br /><div><strong>To: </strong>dfaure, djarvie, smartins, mwolff, dvratil<br /><strong>Cc: </strong>knauss, kde-pim, KDE PIM, dvasin, winterz, vkrause, mlaurent, dvratil<br /></div>