# Fix for #68021

- Thread: https://externals.io/message/77286
- Original archive: https://news-web.php.net/php.internals/77286
- Started by Tjerk Meesters on 2014-09-17T13:51:57+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #77286 — Tjerk Meesters — 2014-09-17T13:51:57+00:00

URL: https://externals.io/message/77286#77286

Hi,

I’ve authored a fix for browscap: https://github.com/php/php-src/pull/827

Bug report: https://bugs.php.net/bug.php?id=68021

It replaces the current expression delimiters of \xA7 with a tilde (~) that’s ASCII compatible and therefore plays nice with UTF-8.

Seems like a no-brainer to apply this to 5.4 onwards, but perhaps somebody has a compelling reason why those section symbols are an absolute necessity.

---

## #77287 — johannes@schlueters.de — 2014-09-17T14:03:15+00:00

URL: https://externals.io/message/77286#77287 · In reply to: #77286

> Hi,
> 
> I’ve authored a fix for browscap:
> https://github.com/php/php-src/pull/827
> 
> Bug report: https://bugs.php.net/bug.php?id=68021
> 
> It replaces the current expression delimiters of \xA7 with a tilde (~)
> that’s ASCII compatible and therefore plays nice with UTF-8.
> 
> Seems like a no-brainer to apply this to 5.4 onwards, but perhaps
> somebody has a compelling reason why those section symbols are an
> absolute necessity.
> 
Do you know that there is no and will never be a useragent string (and
thus a regexp) containing the ~ in any valid browscap file? The current
\xA7 is a quite safe guess, I'd say.

If this is changed is done I'd suggest escaping the regexp accordingly
to be on the safe side.

johannes

P.S. see i.e.
"[e-SocietyRobot(http://www.yama.info.waseda.ac.jp/~yamana/es/)]" which
seems to exist in the current browscap version.

---

## #77288 — johannes@schlueters.de — 2014-09-17T14:06:05+00:00

URL: https://externals.io/message/77286#77288 · In reply to: #77287

> 
> If this is changed is done I'd suggest escaping the regexp accordingly
> to be on the safe side.

ah, I see this is already done. Still see no big need to limit this to
ASCII (yes, I read the user's report)

johannes
