# ctype functions going, going, gone?

- Thread: https://externals.io/message/44963
- Original archive: https://news-web.php.net/php.internals/44963
- Started by Keryx Web on 2009-07-14T20:58:35+00:00
- Messages: 5
- 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

---

## #44963 — Keryx Web — 2009-07-14T20:58:35+00:00

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

Hi all!

I am preparing a Server Side Scripting (using PHP) course for the Web 
Standards Project Interact[1]. As I am going through security 
considerations I note that the ctype functions are being used in the 
manual[2] and have not been deprecated in 5.3. I have, however, been 
told that they are not, nor ever will be, Unicode compatible.[3]

If that indeed is the case:

A. Should they not be deprecated formally, including giving an 
appropriate error when used? (Yes, that will give some people, like me, 
lots of errors. But I rather take them now than have my code blow up on 
me in the future.)

B. Should not the the manual be telling people about these functions 
being non-future proof?


-- 
Keryx Web (Lars Gunther)
http://keryx.se/
http://twitter.com/itpastorn/
http://itpastorn.blogspot.com/

1. http://interact.webstandards.org/
2. http://www.php.net/manual/en/security.filesystem.php
3. http://marc.info/?l=phpdoc&m=119678432606169

P.S. If you are interested in helping us at WaSP make an awesome 
curriculum for our PHP course, contact me off list.

---

## #44966 — Andrei Zmievski — 2009-07-14T22:06:50+00:00

URL: https://externals.io/message/44963#44966 · In reply to: #44963

> Hi all!
>
> I am preparing a Server Side Scripting (using PHP) course for the Web
> Standards Project Interact[1]. As I am going through security considerations
> I note that the ctype functions are being used in the manual[2] and have not
> been deprecated in 5.3. I have, however, been told that they are not, nor
> ever will be, Unicode compatible.[3]
>
> If that indeed is the case:
>
> A. Should they not be deprecated formally, including giving an appropriate
> error when used? (Yes, that will give some people, like me, lots of errors.
> But I rather take them now than have my code blow up on me in the future.)
>
> B. Should not the the manual be telling people about these functions being
> non-future proof?
>

I believe the latest discussion settled on rewriting ctype_* functions to
use ICU internally in HEAD, so that they work correctly on Unicode strings.

-Andrei

---

## #44974 — Keryx Web — 2009-07-15T09:23:20+00:00

URL: https://externals.io/message/44963#44974 · In reply to: #44966

> I believe the latest discussion settled on rewriting ctype_* functions
> to use ICU internally in HEAD, so that they work correctly on Unicode
> strings.
>
> -Andrei

That simplifies things. I actually believe that the word about this has 
to spread, since I am not the only one with the impression that these 
functions are going.[1][2][3]

I can not find any open bugs on this, but did find the meeting notes 
that confirms Andrei's message.[4]

As for mixed messages. Is not the fact that they are listed on this 
page: http://www.php.net/~scoates/unicode/render_func_data.php an 
indication that the work already has been done?

Also: Am I correct in assuming that the new ICU-based ctype functions 
will use locale_set_default() instead of `setlocale()`?

(A side note: Will the preg-functions continue to use `setlocale()`?)

And finally, I hope my asking these questions are not out of place. I 
chose this list since I need authoritative answers and my questions are 
about internals issues. I beg your forgiveness if I have contributed to 
any unnecessary noise.


-- 
Keryx Web (Lars Gunther)
http://keryx.se/
http://twitter.com/itpastorn/
http://itpastorn.blogspot.com/

1. http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3529073
2. http://devzone.zend.com/article/2448
3. http://wiki.php.net/todo/php60 Item 1:7

4. http://wiki.php.net/summits/pdmnotesmay09

---

## #45014 — Keryx Web — 2009-07-17T09:21:58+00:00

URL: https://externals.io/message/44963#45014 · In reply to: #44974

Please forgive me bumping this, bit I think my questions are valid and I 
can't find authoritative and relevant info on php.net or Google.

If indeed I have broken protocol, as feared in my ending, could anyone 
please tell me so (off list in order to reduce the noise, of course) and 
kindly point me to a better place to ask these questions?



> 
>
> > […]
>
> That simplifies things. I actually believe that the word about this has
> to spread, since I am not the only one with the impression that these
> functions are going.[1][2][3]
>
> I can not find any open bugs on this, but did find the meeting notes
> that confirms Andrei's message.[4]
>
> As for mixed messages. Is not the fact that they are listed on this
> page: http://www.php.net/~scoates/unicode/render_func_data.php an
> indication that the work already has been done?
>
> Also: Am I correct in assuming that the new ICU-based ctype functions
> will use locale_set_default() instead of `setlocale()`?
>
> (A side note: Will the preg-functions continue to use `setlocale()`?)
>
> And finally, I hope my asking these questions are not out of place. I
> chose this list since I need authoritative answers and my questions are
> about internals issues. I beg your forgiveness if I have contributed to
> any unnecessary noise.
>
>1. http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3529073
 > 2. http://devzone.zend.com/article/2448
 > 3. http://wiki.php.net/todo/php60 Item 1:7
 >
 > 4. http://wiki.php.net/summits/pdmnotesmay09

-- 
Keryx Web (Lars Gunther)
http://keryx.se/
http://twitter.com/itpastorn/
http://itpastorn.blogspot.com/

---

## #45016 — Hannes Magnusson — 2009-07-17T10:38:13+00:00

URL: https://externals.io/message/44963#45016 · In reply to: #45014

> Please forgive me bumping this, bit I think my questions are valid and I
> can't find authoritative and relevant info on php.net or Google.

The future has yet to be written. All we can do is to predict.
The current prediction is that ctype will use the ICU functionality.

-Hannes
