From kde-core-devel Mon Aug 17 21:42:42 2009 From: Thomas =?utf-8?q?L=C3=BCbking?= Date: Mon, 17 Aug 2009 21:42:42 +0000 To: kde-core-devel Subject: Re: Review Request: Fix sanitization of dbus path in KMainWindow Message-Id: <200908172342.43100.thomas.luebking () web ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=125054568717289 Am Monday 17 August 2009 schrieb Matthew Woehlke: > Thomas Lübking wrote: > > Performance ain't crucial here (and QChar::isLetter() just tests some > > flags), but i just tested and QChar grants ::isLetter to really a lot of > > stuff (esp. as any utf-8 char seems to be split an the first part becomes > > a letter, though it's /no/ [A-Za-z] :-( > > Ah... doesn't that make QString::mid broken? (Or would that be QChar?) > Though that shouldn't be a problem if e.g. "駄" gets translated to "G_q_". "駄" (except the """s") has QString::length() == 3 all are represented by some weird "?" in a diamond, no substring matches the identifier regexp 駄[0].isLetter() == true 駄[1].isLetter() == false 駄[2].isLetter() == false "ü" has QString::length() == 2 all are represented by some weird "?" in a diamond, no substring matches the ü[0].isLetter() == true ü[1].isLetter() == false I don't know whether this makes QString or QChar "broken"* but the suggested solution guarantees a valid dbus path -regarding the object name- which in doubt ends up like "_________" ;-P Thomas *i'd preferably force the whole world to restrict to ASCII - that's two more letters than the romans needed to control an empire for a millenium >-)