# Need a cache for ucnv_open()

- Thread: https://externals.io/message/17965
- Original archive: https://news-web.php.net/php.internals/17965
- Started by Wez Furlong on 2005-08-13T13:52:44+00:00
- Messages: 4
- 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

---

## #17965 — Wez Furlong — 2005-08-13T13:52:44+00:00

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

A number of extensions/functions (strangely, most of the things I work
on :-) will need to be able to convert between unicode and arbitrary
encodings.  It makes a lot of sense to keep some kind of per-request
cache (of limited length) to avoid having to load and unload the
conversion table on each conversion attempt.

Since this cache needs to always be present (to avoid crazy
conditional compilation) we either need to put it in zend_unicode.c or
put it in ext/unicode and always require it to be statically compiled
into php.

Thoughts?

--Wez.

---

## #17983 — cshmoove@bellsouth.net — 2005-08-13T20:11:33+00:00

URL: https://externals.io/message/17965#17983 · In reply to: #17965

Wez,
  zend_unicode.c may be a good bet, since the engine has to deal with 
various encodings anyway (script, output, runtime)

clayton

"Wez Furlong" <kingwez@gmail.com> wrote in message 
news:4e89b4260508130652655bcff2@mail.gmail.com...

Since this cache needs to always be present (to avoid crazy
conditional compilation) we either need to put it in zend_unicode.c or
put it in ext/unicode and always require it to be statically compiled
into php.

Thoughts?

--Wez.

---

## #18022 — Jani Taskinen — 2005-08-14T01:45:32+00:00

URL: https://externals.io/message/17965#18022 · In reply to: #17965

I'd go with zend_unicode.c as you can disable ext/unicode.

     --Jani



> A number of extensions/functions (strangely, most of the things I work
> on :-) will need to be able to convert between unicode and arbitrary
> encodings.  It makes a lot of sense to keep some kind of per-request
> cache (of limited length) to avoid having to load and unload the
> conversion table on each conversion attempt.
>
> Since this cache needs to always be present (to avoid crazy
> conditional compilation) we either need to put it in zend_unicode.c or
> put it in ext/unicode and always require it to be statically compiled
> into php.
>
> Thoughts?
>
> --Wez.
>
>

-- 
Donate @ http://pecl.php.net/wishlist.php/sniper

---

## #18036 — Andrei Zmievski — 2005-08-14T04:50:59+00:00

URL: https://externals.io/message/17965#18036 · In reply to: #17965

zend_unicode.c is the place for it, IMHO.

-Andrei




> A number of extensions/functions (strangely, most of the things I work
> on :-) will need to be able to convert between unicode and arbitrary
> encodings.  It makes a lot of sense to keep some kind of per-request
> cache (of limited length) to avoid having to load and unload the
> conversion table on each conversion attempt.
>
> Since this cache needs to always be present (to avoid crazy
> conditional compilation) we either need to put it in zend_unicode.c or
> put it in ext/unicode and always require it to be statically compiled
> into php.
>
> Thoughts?
>
> --Wez.
