# intl win32, which ICU version and binaries?

- Thread: https://externals.io/message/36904
- Original archive: https://news-web.php.net/php.internals/36904
- Started by Pierre Joye on 2008-04-09T13:45:38+00:00
- Messages: 12
- 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

---

## #36904 — Pierre Joye — 2008-04-09T13:45:38+00:00

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

Hi!

I'm running some more tests and evaluation on windows and got stuck in
the build session. Which ICU version do you use? Or do you use the
binaries provided by IBM (I tried with vc2k3 without much success)?

It would be helpful if you can put your ICU binaries and dev files
somewhere (ideally for vc6, 2k3 or 5).

Thanks in advance,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36908 — Stanislav Malyshev — 2008-04-09T16:56:39+00:00

URL: https://externals.io/message/36904#36908 · In reply to: #36904

> I'm running some more tests and evaluation on windows and got stuck in
> the build session. Which ICU version do you use? Or do you use the
> binaries provided by IBM (I tried with vc2k3 without much success)?

Any since 2.6 should be fine. I think I was using ones from here: 
http://www.icu-project.org/download/

-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36915 — Pierre Joye — 2008-04-10T10:08:49+00:00

URL: https://externals.io/message/36904#36915 · In reply to: #36908

>
> > […]
>
>  Any since 2.6 should be fine. I think I was using ones from here:
> http://www.icu-project.org/download/

Is what I get:

http://phpfi.com/308828

I did not investigate further yet but it may be simply a missing include.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36918 — Pierre Joye — 2008-04-10T12:27:22+00:00

URL: https://externals.io/message/36904#36918 · In reply to: #36915

> 
> > […]
>
>  Is what I get:
>
>  http://phpfi.com/308828
>
>  I did not investigate further yet but it may be simply a missing include.

A little note about the error, it seems to be related to the
UnicodeString initialization (line 139, srcString). I'm not sure
what's the correct way to do it, I have to RTFM :)

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36924 — Stanislav Malyshev — 2008-04-10T18:13:23+00:00

URL: https://externals.io/message/36904#36924 · In reply to: #36915

Hi!

> 
> Is what I get:
> 
> http://phpfi.com/308828
> 
> I did not investigate further yet but it may be simply a missing include.

I've fixed the ascii_check issue, but don't see other ones, current CVS 
builds fine for me.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36925 — Pierre Joye — 2008-04-10T18:41:55+00:00

URL: https://externals.io/message/36904#36925 · In reply to: #36924

> Hi!
>
>
>
> > […]
>
>  I've fixed the ascii_check issue, but don't see other ones, current CVS
> builds fine for me.

UnicodeString::UnicodeString(unsigned short const *,int) seems
actually wrong, for what I can see in the headers. There is no
constructor with this signature. I'm also not sure that initializing
it this way is correct, should you not use the UNICODE_STRING macro?
Or is it only for static string? I used the C equivalent macros
(U_STRING_DECL/INIT) with 2.x, not sure what's the current policy
(using 3.6).

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36927 — Stanislav Malyshev — 2008-04-10T19:07:37+00:00

URL: https://externals.io/message/36904#36927 · In reply to: #36925

Hi!

> UnicodeString::UnicodeString(unsigned short const *,int) seems
> actually wrong, for what I can see in the headers. There is no

It builds on my machine. And it uses UnicodeString(UChar *, int) which 
looks OK and ctor with this signature is defined in unistr.h.

> it this way is correct, should you not use the UNICODE_STRING macro?

Seems to be roughly the same...
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36929 — Pierre Joye — 2008-04-10T19:43:01+00:00

URL: https://externals.io/message/36904#36929 · In reply to: #36927

> Hi!
>
>
>
> > […]
>
>  It builds on my machine. And it uses UnicodeString(UChar *, int) which
> looks OK and ctor with this signature is defined in unistr.h.
>
>
>
> > […]
>
>  Seems to be roughly the same...

Ah? in 3.6/8 it takes three arguments on my architecture (win xp,
32bit mode with amd64). Which version do you use?

The define:
#if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR &&
(U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 &&
defined(U_WCHAR_IS_UTF16)))
#   define UNICODE_STRING(cs, _length) UnicodeString(TRUE, (const
UChar *)L ## cs, _length)
#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY
#   define UNICODE_STRING(cs, _length) UnicodeString(TRUE, (const
UChar *)cs, _length)
#else
#   define UNICODE_STRING(cs, _length) UnicodeString(cs, _length, US_INV)
#endif



Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36930 — Stanislav Malyshev — 2008-04-10T19:46:10+00:00

URL: https://externals.io/message/36904#36930 · In reply to: #36929

Hi!

> Ah? in 3.6/8 it takes three arguments on my architecture (win xp,
> 32bit mode with amd64). Which version do you use?

I have ICU 3.6 AFAIK. Here's a quote from unistr.h:

   /**
    * UChar* constructor.
    * @param text The characters to place in the UnicodeString.
    * @param textLength The number of Unicode characters in <TT>text</TT>
    * to copy.
    * @stable ICU 2.0
    */
   UnicodeString(const UChar *text,
         int32_t textLength);

It compiles and it seems to work. Do you know about any problem with it?

-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36932 — Pierre Joye — 2008-04-11T07:18:33+00:00

URL: https://externals.io/message/36904#36932 · In reply to: #36930

> > […]
>
>  I have ICU 3.6 AFAIK. Here's a quote from unistr.h:
>
>   /**
>    * UChar* constructor.
>    * @param text The characters to place in the UnicodeString.
>    * @param textLength The number of Unicode characters in <TT>text</TT>
>    * to copy.
>    * @stable ICU 2.0
>    */
>   UnicodeString(const UChar *text,
>         int32_t textLength);
>
>  It compiles and it seems to work. Do you know about any problem with it?

It should actually work. The idea behind the macro is to allow some
optimization/performance tricks depending of the architecture. But for
some unknown reasons, using their binaries or my own builds I keep
getting this error with the UnicodeString constructor (using VC 2k3).
Which VC do you use?

Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36963 — Stanislav Malyshev — 2008-04-11T18:10:12+00:00

URL: https://externals.io/message/36904#36963 · In reply to: #36932

> Which VC do you use?

VS 2005.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36990 — Pierre Joye — 2008-04-12T20:16:43+00:00

URL: https://externals.io/message/36904#36990 · In reply to: #36963

2008/4/11 Stanislav Malyshev <stas@zend.com>:
>
>
> > […]
>
>  VS 2005.

Ok, the build finally works. It seems to be a bug in VC 2003, the
UnicodeString declaration makes it crazy (and extract).

As ICU 3.6 can't be build with anything but 2003, I used IBM's
binaries with VC 2005 and it works. But it is not a good thing, ICU
and PHP should be built using the same compilers, VC 2005 or VC 6 (I
hope we'll drop it for php6). I'm not sure if using cygwin built will
work well but it can be an alternative.

A side note about the sources, it will be nice if all intl developers
define the PHP coding standard (like tabs and no space, indentation,
etc.) in their favorite editors and use the same line endings (there
is mac, windows and linux in there).

Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org
