# How to get started with Unicode

- Thread: https://externals.io/message/17848
- Original archive: https://news-web.php.net/php.internals/17848
- Started by Andrei Zmievski on 2005-08-11T23:36:56+00:00
- Messages: 11
- 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

---

## #17848 — Andrei Zmievski — 2005-08-11T23:36:56+00:00

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

By now, Unicode merge into the public tree has taken place. How do you 
get started?

1. Take a deep breath.

2. Download and build ICU 3.4.

     Location: 
http://www-306.ibm.com/software/globalization/icu/downloads.jsp

     Extract and cd into icu/source. Execute configure (replacing 
/usr/local with your prefix):

    	./configure  --prefix=/usr/local --disable-threads --enable-extras 
--enable-icuio --enable-layout

     make and make install

2. Update to PHP CVS HEAD (cvs upd -dPA) or better, do a clean 
check-out.

3. Run ./buildconf.

4. Run ./configure and use --with-icu-dir=<dir> if you put ICU in a 
non-standard location.

5. Hopefully it configures without a problem.

6. Cross your fingers (better, cross your toes too) and run 'make'.

7. Once the smoke dissipates (and if you're on Powerbook, once it cools 
down from nuclear to just melting hot), you can continue.

Since you have not turned unicode_semantics switch on, you should be 
able to run all the old scripts. If you'd like to dabble in the Unicode 
land, the suggested way to configure for it is something like this:

   unicode_semantics = on
   unicode.runtime_encoding = iso-8859-1 (or your favorite one)
   unicode.script_encoding = utf-8
   unicode.output_encoding = utf-8
   unicode.from_error_mode = U_INVALID_SUBSTITUTE
   unicode.from_error_subst_char = 3f

Now you can get your hands dirty.

If you'd like to see how certain functions have been upgraded to 
accommodate Unicode and binary types, check out `substr()`, `explode()`, 
 `trim()`, `str_repeat()`, and `strlen()`.

ICU API reference is at http://icu.sourceforge.net/

There is a new 'make' target called 'utest' - it is supposed to turn 
unicode_semantics switch on and run all the tests. I don't think it 
will quite work, due to changes in the streams and some other things, 
so that might be the first thing to get fixed.

A writeup about new APIs and function upgrade guidelines will be coming 
up, but not today, because you need time to digest this and I need time 
to recover. :-)

Have fun,

-Andrei

---

## #17861 — Michael Wallner — 2005-08-12T07:13:01+00:00

URL: https://externals.io/message/17848#17861 · In reply to: #17848

Hi Andrei Zmievski, you wrote:

> 2. Download and build ICU 3.4.

Quick question: can one use the provided binary packages for Win32?

Thanks,
--
Michael - < mike(@)php.net

---

## #17862 — Derick Rethans — 2005-08-12T07:26:20+00:00

URL: https://externals.io/message/17848#17862 · In reply to: #17848

> 2. Download and build ICU 3.4.
> 
>     Location: http://www-306.ibm.com/software/globalization/icu/downloads.jsp

For Debian users, doing "apt-get install libicu34-dev" should pull it in 
(on debian unstable).

Derick

---

## #17864 — Michael Wallner — 2005-08-12T09:09:59+00:00

URL: https://externals.io/message/17848#17864 · In reply to: #17861

I wrote:

> Quick question: can one use the provided binary packages for Win32?

Not unless one has MSVC-7.1 -- it seems...

--
Michael - < mike(@)php.net

---

## #17865 — Edin Kadribasic — 2005-08-12T11:54:22+00:00

URL: https://externals.io/message/17848#17865 · In reply to: #17864

Here:

http://ftp.emini.dk/pub/php/win32/icu-3.4-MSVC-6.0.zip

Edin


Michael Wallner wrote:

>I wrote:
>
>  
>
> > […]
>
>Not unless one has MSVC-7.1 -- it seems...
>
>--
>Michael - < mike(@)php.net

---

## #17867 — Antony Dovgal — 2005-08-12T13:39:05+00:00

URL: https://externals.io/message/17848#17867 · In reply to: #17848

On Thu, 11 Aug 2005 16:36:56 -0700
Andrei Zmievski <andrei@gravitonic.com> wrote:

> By now, Unicode merge into the public tree has taken place. How do you 
> get started?
> 
> 1. Take a deep breath.
> 
> 2. Download and build ICU 3.4.

SuSE users can use fresh 3.4 rpms from the link below.
You'll most likely need all icu* & libicu* rpms.

http://tony2001.phpclub.net/files/rpms/suse/9.3/

-- 
Wbr, 
Antony Dovgal

---

## #17875 — Nuno Lopes — 2005-08-12T16:16:35+00:00

URL: https://externals.io/message/17848#17875 · In reply to: #17848

Just a note to tell you that the build is broken when configured with 
'--disable-zend-memory-manager'.
Thats because you forgot to add the eumaloc() and friends in the else part 
of USE_ZEND_MALLOC (zend_alloc.h).

Nuno

---

## #17879 — Andrei Zmievski — 2005-08-12T17:14:49+00:00

URL: https://externals.io/message/17848#17879 · In reply to: #17875

Should be fixed now.

-Andrei



> Just a note to tell you that the build is broken when configured with 
> '--disable-zend-memory-manager'.
> Thats because you forgot to add the eumaloc() and friends in the else 
> part of USE_ZEND_MALLOC (zend_alloc.h).
>
> Nuno

---

## #17880 — Nuno Lopes — 2005-08-12T17:28:08+00:00

URL: https://externals.io/message/17848#17880 · In reply to: #17879

It doesn't output so many errors as before, but still fails:
"undefined reference to 'zend_ustrdup'"

Nuno


----- Original Message ----- 
> Should be fixed now.
> 
> -Andrei
> 
> 
> 
> > […]

---

## #17901 — Nuno Lopes — 2005-08-12T18:51:40+00:00

URL: https://externals.io/message/17848#17901 · In reply to: #17848

Attached is a patch to fix the build with zend mm disabled. (just a little 
typo)

Nuno

---

## #17939 — Xuefer — 2005-08-13T03:43:14+00:00

URL: https://externals.io/message/17848#17939 · In reply to: #17901

missing "charset=" in content-type header when unicode.output_encoding
is set to other than utf-8

is_binary() is_unicode()? (while there is `is_string()`)
and is_buffer() for string/binary/unicode?

but pls fix `extract()` at very first as it inject variable in active
symbol table.
