Index: config_office/configure.in
===================================================================
RCS file: /cvs/tools/config_office/configure.in,v
retrieving revision 1.173.2.3
diff -u -u -r1.173.2.3 configure.in
--- config_office/configure.in	28 Aug 2006 08:37:20 -0000	1.173.2.3
+++ config_office/configure.in	1 Oct 2006 22:31:41 -0000
@@ -268,9 +268,9 @@
 AC_ARG_WITH(system-python,
 [  --with-system-python    Use python already on system
 ],,)
-#AC_ARG_WITH(system-icu,
-#[  --with-system-icu       Use icu already on system
-#],,)
+AC_ARG_WITH(system-icu,
+[  --with-system-icu       Use icu already on system
+],,)
 AC_ARG_WITH(system-db,
 [  --with-system-db        Use berkeley db already on system
 ],,)
@@ -3503,32 +3500,51 @@
 fi
 AC_SUBST(SYSTEM_SANE_HEADER)
 
-# DISABLED; INCOMPLETE
 dnl ===================================================================
 dnl Check for system icu
 dnl ===================================================================
-#AC_MSG_CHECKING([which icu to use])
-#if test -n "$with_system_icu" -o -n "$with_system_libs" && \
-#	test "$with_system_icu" != "no"; then
-#   AC_MSG_RESULT([external])
-#   SYSTEM_ICU=YES
-#   AC_MSG_CHECKING([for unicode/rbbi.h])
-#   AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
-#   AC_PATH_PROG(SYSTEM_GENBRK, genbrk)
-#   if test -z "$SYSTEM_GENBRK"; then
-#      AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
-#   fi
-#   AC_PATH_PROG(SYSTEM_GENCCODE, genccode)
-#   if test -z "$SYSTEM_GENCCODE"; then
-#      AC_MSG_ERROR([\"genccode\" not found in \$PATH, install the icu development tool \"genccode"\])
-#   fi
-#else
-#    AC_MSG_RESULT([internal])
-#    SYSTEM_ICU=NO
-#fi
-#AC_SUBST(SYSTEM_ICU)
-#AC_SUBST(SYSTEM_GENBRK)
-#AC_SUBST(SYSTEM_GENCCODE)
+AC_MSG_CHECKING([which icu to use])
+if test -n "$with_system_icu" -o -n "$with_system_libs" && \
+       test "$with_system_icu" != "no"; then
+   AC_MSG_RESULT([external])
+   SYSTEM_ICU=YES
+   AC_MSG_CHECKING([for unicode/rbbi.h])
+   AC_TRY_CPP(unicode/rbbi.h, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([icu headers not found.]))
+   AC_PATH_PROG(SYSTEM_GENBRK, genbrk)
+   if test -z "$SYSTEM_GENBRK"; then
+      AC_MSG_ERROR([\"genbrk\" not found in \$PATH, install the icu development tool \"genbrk"\])
+   fi
+   AC_PATH_PROG(SYSTEM_GENCCODE, genccode)
+   if test -z "$SYSTEM_GENCCODE"; then
+      AC_MSG_ERROR([\"genccode\" not found in \$PATH, install the icu development tool \"genccode"\])
+   fi
+   AC_MSG_CHECKING([ICU version])
+for v in 4 6; do
+       AC_TRY_RUN([
+#include <unicode/uversion.h>
+
+int main(int argc, char **argv) {
+       if(U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == $v) return 0;
+       else return 1;
+}
+       ], [ICU_VERSION_MINOR=$v], [])
+    done
+    if test "$ICU_VERSION_MINOR" -ge "4"; then
+       AC_MSG_RESULT([OK])
+       ICU_VERSION=3.$ICU_VERSION_MINOR
+    else
+       AC_MSG_ERROR([no. you need at least icu 3.4])
+    fi
+else
+    AC_MSG_RESULT([internal])
+    SYSTEM_ICU=NO
+    BUILD_TYPE="$BUILD_TYPE ICU"
+    ICU_VERSION=2.6
+fi
+AC_SUBST(SYSTEM_ICU)
+AC_SUBST(SYSTEM_GENBRK)
+AC_SUBST(SYSTEM_GENCCODE)
+AC_SUBST(ICU_VERSION)
 
 dnl ===================================================================
 dnl Checks for libraries.
Index: config_office/set_soenv.in
===================================================================
RCS file: /cvs/tools/config_office/set_soenv.in,v
retrieving revision 1.112.2.2
diff -u -u -r1.112.2.2 set_soenv.in
--- config_office/set_soenv.in	28 Aug 2006 08:37:34 -0000	1.112.2.2
+++ config_office/set_soenv.in	1 Oct 2006 22:31:47 -0000
@@ -1763,9 +1763,10 @@
 ToFile( "SYSTEM_PYTHON",     "@SYSTEM_PYTHON@",    "e" );
 ToFile( "PYTHON_CFLAGS",     "@PYTHON_CFLAGS@",    "e" );
 ToFile( "PYTHON_LIBS",       "@PYTHON_LIBS@",      "e" );
-#ToFile( "SYSTEM_ICU",        "@SYSTEM_ICU@",       "e" );
-#ToFile( "SYSTEM_GENBRK",     "@SYSTEM_GENBRK@",    "e" );
-#ToFile( "SYSTEM_GENCCODE",   "@SYSTEM_GENCCODE@",  "e" );
+ToFile( "SYSTEM_ICU",        "@SYSTEM_ICU@",       "e" );
+ToFile( "SYSTEM_GENBRK",     "@SYSTEM_GENBRK@",    "e" );
+ToFile( "SYSTEM_GENCCODE",   "@SYSTEM_GENCCODE@",  "e" );
+ToFile( "ICU_VERSION",	     "@ICU_VERSION@",      "e" );
 ToFile( "SYSTEM_JPEG",       "@SYSTEM_JPEG@",      "e" );
 ToFile( "SYSTEM_FREETYPE",   "@SYSTEM_FREETYPE@",  "e" );
 ToFile( "FREETYPE_CFLAGS",   "@FREETYPE_CFLAGS@",  "e" );
Index: i18npool/prj/build.lst
===================================================================
RCS file: /cvs/l10n/i18npool/prj/build.lst,v
retrieving revision 1.21
diff -u -u -r1.21 build.lst
--- i18npool/prj/build.lst	24 May 2006 14:16:22 -0000	1.21
+++ i18npool/prj/build.lst	1 Oct 2006 22:32:14 -0000
@@ -1,4 +1,4 @@
-inp  i18npool    :   bridges sax stoc comphelper icu i18nutil regexp NULL
+inp  i18npool    :   bridges sax stoc comphelper ICU:icu i18nutil regexp NULL
 inp  i18npool                                   usr1    -   all inp_mkout NULL
 inp  i18npool\source\registerservices           nmake   -   all inp_rserv NULL
 inp  i18npool\source\breakiterator              nmake   -   all inp_brkit NULL
Index: i18npool/source/breakiterator/makefile.mk
===================================================================
RCS file: /cvs/l10n/i18npool/source/breakiterator/makefile.mk,v
retrieving revision 1.10
diff -u -u -r1.10 makefile.mk
--- i18npool/source/breakiterator/makefile.mk	20 Jun 2006 04:42:28 -0000	1.10
+++ i18npool/source/breakiterator/makefile.mk	1 Oct 2006 22:32:14 -0000
@@ -51,12 +51,27 @@
 MY_BRK_TXTFILES:=$(shell ls data/*.txt)
 
 # insert "OpenOffice" as icu package name in front of the  name of each rule file for searching on application provided data
+.IF "$(ICU_VERSION)" == "3.6"
+MY_BRK_BRKFILES:=$(subst,data/,$(MISC)$/ $(MY_BRK_TXTFILES:s/.txt/.brk/))
+.ELSE
 MY_BRK_BRKFILES:=$(subst,data/,$(MISC)$/OpenOffice_ $(MY_BRK_TXTFILES:s/.txt/.brk/))
+.ENDIF
 
+.IF "$(ICU_VERSION)" != "3.6"
+MY_BRK_NAMEDBRKFILES:=$(subst,data/,OpenOffice_ $(MY_BRK_TXTFILES:s/.txt/.brk/))
+.ENDIF
+
+.IF "$(ICU_VERSION)" == "3.6"
+# OpenOffice_dat.c is a generated file from the rule file list by gencmn
+MY_MISC_CXXFILES := \
+        $(MISC)$/OpenOffice_dat.c \
+        $(MY_BRK_BRKFILES:s/.brk/_brk.c/)
+.ELSE
 # OpenOffice_icu_dat.c is a generated file from the rule file list by gencmn
 MY_MISC_CXXFILES := \
         $(MISC)$/OpenOffice_icu_dat.c \
         $(MY_BRK_BRKFILES:s/.brk/_brk.c/)
+.ENDIF
 
 SLOFILES=   \
 	    $(SLO)$/breakiteratorImpl.obj \
@@ -82,13 +97,23 @@
 # The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools,
 # so the output (OpenOffice_icu_dat.c) is changed here to include a pragma to disable the warnings.
 # Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch.
+.IF "$(ICU_VERSION)" == "3.6"
+$(MISC)$/OpenOffice_dat.c :  $(MY_BRK_BRKFILES) makefile.mk
+    +$(WRAPCMD) gencmn -n OpenOffice -S -d $(MISC) O $(mktmp $(subst,$(MISC)$/, $(MY_BRK_BRKFILES:t"\n")))
+$(MISC)$/%.brk : data/%.txt
+    +$(WRAPCMD) genbrk -r $< -o $(MISC)$/$*.brk
+$(MISC)$/%_brk.c : $(MISC)$/%.brk
+    +$(WRAPCMD) genccode -n OpenOffice -d $(MISC)$ $(MISC)$/$*.brk
+.ELSE
 $(MISC)$/OpenOffice_icu_dat.c :  $(MY_BRK_BRKFILES)
-    +$(WRAPCMD) $(SOLARBINDIR)$/gencmn -e OpenOffice_icu -n OpenOffice_icu -t tmp -S -d $(MISC) O $(mktmp $(MY_BRK_BRKFILES:t"\n"))
+    +$(WRAPCMD) gencmn -e OpenOffice_icu -n OpenOffice_icu -t tmp -S -d $(MISC) O $(mktmp $(MY_BRK_NAMEDBRKFILES:t"\n"))
     +echo $(USQ)#ifdef _MSC_VER$(USQ) > $@
     +echo $(USQ)#pragma warning( disable : 4229 4668 )$(USQ) >> $@
     +echo $(USQ)#endif$(USQ) >> $@
     +$(TYPE) $(@:s/_dat/_tmp/) >> $@
 $(MISC)$/OpenOffice_%.brk : data/%.txt
-    +$(WRAPCMD) $(SOLARBINDIR)$/genbrk -r $< -o $(MISC)$/OpenOffice_$*.brk
+    +$(WRAPCMD) genbrk -r $< -o $(MISC)$/OpenOffice_$*.brk
 $(MISC)$/%_brk.c : $(MISC)$/%.brk
-    +$(WRAPCMD) $(SOLARBINDIR)$/genccode -d $(MISC)$ $(MISC)$/$*.brk
+    +$(WRAPCMD) genccode -e OpenOffice_icu -n OpenOffice_icu -d $(MISC)$ $(MISC)$/$*.brk
+.ENDIF
+
Index: linguistic/source/hhconvdic.cxx
===================================================================
RCS file: /cvs/sw/linguistic/source/hhconvdic.cxx,v
retrieving revision 1.6
diff -u -u -r1.6 hhconvdic.cxx
--- linguistic/source/hhconvdic.cxx	7 Apr 2006 13:48:10 -0000	1.6
+++ linguistic/source/hhconvdic.cxx	1 Oct 2006 22:32:19 -0000
@@ -34,7 +34,7 @@
  ************************************************************************/
 
 #ifndef USCRIPT_H
-#include <external/unicode/uscript.h>
+#include <unicode/uscript.h>
 #endif
 
 #ifndef INCLUDED_I18NPOOL_LANG_H
Index: scp2/prj/build.lst
===================================================================
RCS file: /cvs/installation/scp2/prj/build.lst,v
retrieving revision 1.21
diff -u -u -r1.21 build.lst
--- scp2/prj/build.lst	4 Aug 2006 10:08:19 -0000	1.21
+++ scp2/prj/build.lst	1 Oct 2006 22:32:47 -0000
@@ -1,4 +1,4 @@
-cp    scp2    :    setup_native transex3 PYTHON:python icu NULL
+cp    scp2    :    setup_native transex3 PYTHON:python ICU:icu NULL
 cp    scp2                        usr1     -    all    cp_mkout NULL
 cp    scp2\macros                 nmake    -    all    cp_langmacros NULL
 cp    scp2\source\activex         nmake    -    all    cp_activex cp_langmacros NULL
Index: scp2/source/ooo/file_library_ooo.scp
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/file_library_ooo.scp,v
retrieving revision 1.209
diff -u -u -r1.209 file_library_ooo.scp
--- scp2/source/ooo/file_library_ooo.scp	4 Aug 2006 12:39:52 -0000	1.209
+++ scp2/source/ooo/file_library_ooo.scp	1 Oct 2006 22:32:50 -0000
@@ -985,6 +985,8 @@
     Styles = (PACKED,PATCH);
 End
 
+#ifndef SYSTEM_ICU
+
 File gid_File_Lib_Icudata
     TXT_FILE_BODY;
   #ifdef UNX
@@ -1029,6 +1031,8 @@
     Styles = (PACKED);
 End
 
+#endif
+
 File gid_File_Lib_Iiopbrdg
     TXT_FILE_BODY;
     Styles = (PACKED,UNO_COMPONENT,PATCH);
Index: scp2/source/ooo/makefile.mk
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/makefile.mk,v
retrieving revision 1.43
diff -u -u -r1.43 makefile.mk
--- scp2/source/ooo/makefile.mk	20 Apr 2006 13:35:04 -0000	1.43
+++ scp2/source/ooo/makefile.mk	1 Oct 2006 22:32:50 -0000
@@ -45,7 +45,6 @@
 # --- Settings -----------------------------------------------------
 
 .INCLUDE :  settings.mk
-.INCLUDE :  icuversion.mk
 .INCLUDE :  i18npool/version.mk
 
 .IF "$(ENABLE_CRASHDUMP)"!=""
@@ -177,11 +176,17 @@
 SCPDEFS+=-DENABLE_CAIRO
 .ENDIF
 
+.IF "$(SYSTEM_ICU)" == "YES"
+SCPDEFS+=-DSYSTEM_ICU
+.ELSE
+.INCLUDE :  icuversion.mk
 SCPDEFS+=\
     -DICU_MAJOR=$(ICU_MAJOR) \
     -DICU_MINOR=$(ICU_MINOR) \
-    -DICU_MICRO=$(ICU_MICRO) \
-	-DISOLANG_MAJOR=$(ISOLANG_MAJOR)
+    -DICU_MICRO=$(ICU_MICRO)
+.ENDIF
+
+SCPDEFS+=-DISOLANG_MAJOR=$(ISOLANG_MAJOR)
 
 .IF "$(DISABLE_NEON)" == "TRUE"
 SCPDEFS+=-DDISABLE_NEON
Index: scp2/source/ooo/shortcut_ooo.scp
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/shortcut_ooo.scp,v
retrieving revision 1.20
diff -u -u -r1.20 shortcut_ooo.scp
--- scp2/source/ooo/shortcut_ooo.scp	9 Sep 2005 01:42:03 -0000	1.20
+++ scp2/source/ooo/shortcut_ooo.scp	1 Oct 2006 22:32:50 -0000
@@ -167,6 +167,7 @@
 #endif
 
 #ifdef UNX
+#ifndef SYSTEM_ICU
 
 Shortcut gid_Shortcut_Lib_Icudata_0
     FileID = gid_File_Lib_Icudata;
@@ -175,10 +176,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icudata_1
     FileID = gid_File_Lib_Icudata;
     Dir = gid_Dir_Program;
@@ -186,10 +183,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icui18n_0
     FileID = gid_File_Lib_Icui18n;
     Dir = gid_Dir_Program;
@@ -197,10 +190,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icui18n_1
     FileID = gid_File_Lib_Icui18n;
     Dir = gid_Dir_Program;
@@ -208,10 +197,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icule_0
     FileID = gid_File_Lib_Icule;
     Dir = gid_Dir_Program;
@@ -219,10 +204,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icule_1
     FileID = gid_File_Lib_Icule;
     Dir = gid_Dir_Program;
@@ -230,10 +211,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icuuc_0
     FileID = gid_File_Lib_Icuuc;
     Dir = gid_Dir_Program;
@@ -241,10 +218,6 @@
     Styles = (NETWORK,RELATIVE);
 End
 
-#endif
-
-#ifdef UNX
-
 Shortcut gid_Shortcut_Lib_Icuuc_1
     FileID = gid_File_Lib_Icuuc;
     Dir = gid_Dir_Program;
@@ -253,6 +226,7 @@
 End
 
 #endif
+#endif
 
 #ifdef UNX
 
Index: inc/breakiterator_unicode.hxx
===================================================================
RCS file: /cvs/l10n/i18npool/inc/breakiterator_unicode.hxx,v
retrieving revision 1.13
diff -u -u -r1.13 breakiterator_unicode.hxx
--- i18npool/inc/breakiterator_unicode.hxx	20 Jun 2006 04:40:03 -0000	1.13
+++ i18npool/inc/breakiterator_unicode.hxx	2 Oct 2006 14:11:35 -0000
@@ -102,6 +102,9 @@
 
     struct {
         rtl::OUString aText;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+	UnicodeString aICUText;
+#endif
         icu::BreakIterator *aBreakIterator;
     } character, word, sentence, line, *icuBI; 
     com::sun::star::lang::Locale aLocale;
Index: source/breakiterator/breakiterator_unicode.cxx
===================================================================
RCS file: /cvs/l10n/i18npool/source/breakiterator/breakiterator_unicode.cxx,v
retrieving revision 1.23
diff -u -u -r1.23 breakiterator_unicode.cxx
--- i18npool/source/breakiterator/breakiterator_unicode.cxx	20 Jun 2006 04:42:07 -0000	1.23
+++ i18npool/source/breakiterator/breakiterator_unicode.cxx	13 Oct 2006 18:23:29 -0000
@@ -37,12 +37,25 @@
 #include <unicode/locid.h>
 #include <unicode/rbbi.h>
 #include <unicode/udata.h>
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+#include <rtl/strbuf.hxx>
+#endif
 
 U_CDECL_BEGIN
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+extern const char OpenOffice_dat[];
+#else
 extern const char OpenOffice_icu_dat[];
+#endif
 U_CDECL_END
 
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+#else
 using namespace ::com::sun::star::uno;
+#endif
 using namespace ::com::sun::star::lang;
 using namespace ::rtl;
 
@@ -99,16 +112,53 @@
                         rWordType == WordType::DICTIONARY_WORD ? "dict_word" : "edit_word";
 
             status = U_ZERO_ERROR;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+            udata_setAppData("OpenOffice", OpenOffice_dat, &status);
+#else
             udata_setAppData("OpenOffice", OpenOffice_icu_dat, &status);
+#endif
             if ( !U_SUCCESS(status) ) throw ERROR;
 
             status = U_ZERO_ERROR;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+            OStringBuffer aUDName(64);
+	    aUDName.append(rule);
+	    aUDName.append('_');
+	    aUDName.append( OUStringToOString(rLocale.Language, RTL_TEXTENCODING_ASCII_US));
+	    UDataMemory* pUData = udata_open("OpenOffice", "brk", aUDName.getStr(), &status);
+	    if( U_SUCCESS(status) )
+	        icuBI->aBreakIterator = new RuleBasedBreakIterator( pUData, status);
+#elif U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+            UDataMemory *pData;
+	    if (!rLocale.Language.getLength())
+	        pData=0;
+	    else
+	        pData = udata_open("OpenOffice_icu/OpenOffice", "brk",
+		     OUStringToOString(OUString::createFromAscii(rule)+OUString::createFromAscii("_")+rLocale.Language,
+		     RTL_TEXTENCODING_ASCII_US).getStr(), &status);
+
+	    icuBI->aBreakIterator = (pData && U_SUCCESS(status)) ? new RuleBasedBreakIterator(pData, status) : 0;
+
+	    if ((!U_SUCCESS(status) || !icuBI->aBreakIterator)) {
+#else
             icuBI->aBreakIterator = new RuleBasedBreakIterator(udata_open("OpenOffice", "brk", 
                     OUStringToOString(OUString::createFromAscii(rule)+OUString::createFromAscii("_")+rLocale.Language,
                     RTL_TEXTENCODING_ASCII_US).getStr(), &status), status);
-            if (!U_SUCCESS(status) ) {
+#endif
+#if U_ICU_VERSION_MAJOR_NUM == 2 || (U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6)
+	     if (!U_SUCCESS(status) ) {
+#endif
                 status = U_ZERO_ERROR;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+		pUData = udata_open("OpenOffice", "brk", rule, &status);
+		if( U_SUCCESS(status) )
+		    icuBI->aBreakIterator = new RuleBasedBreakIterator( pUData, status);
+#elif U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+		pData = udata_open("OpenOffice_icu/OpenOffice", "brk", rule, &status);
+		icuBI->aBreakIterator = (pData && U_SUCCESS(status)) ? new RuleBasedBreakIterator(pData, status) : 0;
+#else
                 icuBI->aBreakIterator = new RuleBasedBreakIterator(udata_open("OpenOffice", "brk", rule, &status), status);
+#endif
                 if (!U_SUCCESS(status) ) icuBI->aBreakIterator=NULL;
             }
         }
@@ -151,7 +201,14 @@
 
     if (newBreak || !icuBI->aText.equals(rText)) {
         icuBI->aText = rText;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+	//ICU doesn't copy or reference such a UnicodeString, only a pointer to it, so it must exist
+	//for the duration of the usage
+	icuBI->aICUText = UnicodeString(icuBI->aText.getStr(), icuBI->aText.getLength());
+	icuBI->aBreakIterator->setText(icuBI->aICUText);
+#else
         icuBI->aBreakIterator->setText(UnicodeString(icuBI->aText.getStr(), icuBI->aText.getLength()));
+#endif
     }
 }
 
Index: inc/collator_unicode.hxx
===================================================================
RCS file: /cvs/l10n/i18npool/inc/collator_unicode.hxx,v
retrieving revision 1.7
diff -u -p -u -r1.7 collator_unicode.hxx
--- i18npool/inc/collator_unicode.hxx   21 Jul 2005 14:26:51 -0000      1.7
+++ i18npool/inc/collator_unicode.hxx   13 Sep 2005 13:49:44 -0000
@@ -110,6 +110,9 @@ protected:
     const sal_uInt8 *rulesImage;
 private:
        RuleBasedCollator *collator;
+#if  U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+       RuleBasedCollator *ucacollator;
+#endif
 };

 #define COLLATOR( algorithm ) \
Index: source/collator/collator_unicode.cxx
===================================================================
RCS file: /cvs/l10n/i18npool/source/collator/collator_unicode.cxx,v
retrieving revision 1.13
diff -u -u -r1.13 collator_unicode.cxx
--- i18npool/source/collator/collator_unicode.cxx	20 Jun 2006 04:44:32 -0000	1.13
+++ i18npool/source/collator/collator_unicode.cxx	2 Oct 2006 14:11:38 -0000
@@ -48,11 +48,17 @@
 {
 	implementationName = "com.sun.star.i18n.Collator_Unicode";
 	collator = NULL;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+	ucacollator = NULL;
+#endif
 }
 
 Collator_Unicode::~Collator_Unicode()
 {
 	if (collator) delete collator;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+        if (ucacollator) delete ucacollator;
+#endif
 }
 
 sal_Int32 SAL_CALL
@@ -73,8 +79,25 @@
 	throw(RuntimeException)
 {
 	if (!collator) {
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+	/** ICU collators are loaded using a locale only.
+	    ICU uses Variant as collation algorithm name (like de__PHONEBOOK
+	    locale), note the empty territory (Country) designator in this special
+	    case here. The icu::Locale contructor changes the algorithm name to
+	    uppercase itself, so we don't have to bother with that
+	*/
+	icu::Locale icuLocale(
+	       OUStringToOString(rLocale.Language, RTL_TEXTENCODING_ASCII_US).getStr(),
+	       OUStringToOString(rLocale.Country, RTL_TEXTENCODING_ASCII_US).getStr(),
+	       OUStringToOString(rAlgorithm, RTL_TEXTENCODING_ASCII_US).getStr());
+#endif
         // load ICU collator
         UErrorCode status = U_ZERO_ERROR;
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+	collator = (RuleBasedCollator*) icu::Collator::createInstance(icuLocale, status);
+	if (! U_SUCCESS(status))
+	    throw RuntimeException();
+#endif
         if (OUString::createFromAscii(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) {
             OUStringBuffer aBuf;
 #ifdef SAL_DLLPREFIX
@@ -108,12 +131,22 @@
                 }
                 if (func) {
                     const sal_uInt8* ruleImage=func();
+#if U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 6
+		    collator = new RuleBasedCollator(reinterpret_cast<const uint8_t*>(ruleImage), -1, collator, status);
+#elif U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM == 4
+                    ucacollator = (RuleBasedCollator*) icu::Collator::createInstance("", status);
+		    if (! U_SUCCESS(status))
+		        throw RuntimeException();
+	            collator = new RuleBasedCollator(reinterpret_cast<const uint8_t*>(ruleImage), -1, ucacollator, status);
+#else
                     collator = new RuleBasedCollator(reinterpret_cast<const uint8_t*>(ruleImage), status);
+#endif
                     if (! U_SUCCESS(status))
                         throw RuntimeException();
                 }
                 osl_unloadModule(hModule);
             }
+#if U_ICU_VERSION_MAJOR_NUM != 3 || U_ICU_VERSION_MINOR_NUM != 6
         }
         if (!collator) {
            // load ICU collator
@@ -131,6 +164,7 @@
             collator = (RuleBasedCollator*) icu::Collator::createInstance(icuLocale, status);
             if (! U_SUCCESS(status))
                 throw RuntimeException();
+#endif
         }
     }
 
Index: source/collator/gencoll_rule.cxx
===================================================================
RCS file: /cvs/l10n/i18npool/source/collator/gencoll_rule.cxx,v
retrieving revision 1.8
diff -u -u -r1.8 gencoll_rule.cxx
--- i18npool/source/collator/gencoll_rule.cxx	20 Jun 2006 04:44:43 -0000	1.8
+++ i18npool/source/collator/gencoll_rule.cxx	2 Oct 2006 14:11:39 -0000
@@ -91,8 +91,10 @@
 
 }
 
+#if U_ICU_VERSION_MAJOR_NUM != 3 || U_ICU_VERSION_MINOR_NUM != 6
 U_CAPI uint8_t* U_EXPORT2
 ucol_cloneRuleData(const UCollator *coll, int32_t *length, UErrorCode *status);
+#endif
 
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 {
@@ -135,7 +137,9 @@
     if (U_SUCCESS(status)) {
 
         int32_t len = 0;
+#if U_ICU_VERSION_MAJOR_NUM != 3 || U_ICU_VERSION_MINOR_NUM != 6
         //uint8_t *data = ucol_cloneRuleData(coll, &len, &status);
+#endif
         uint8_t *data = coll->cloneRuleData(len, status);
 
         if (U_SUCCESS(status) && data != NULL)
Index: build.lst
===================================================================
RCS file: /cvs/gsl/vcl/prj/build.lst,v
retrieving revision 1.45
diff -u -u -r1.45 build.lst
--- vcl/prj/build.lst	9 Jun 2006 12:17:59 -0000	1.45
+++ vcl/prj/build.lst	2 Oct 2006 14:13:57 -0000
@@ -1,4 +1,4 @@
-vc	vcl	:	BOOST:boost NAS:nas FREETYPE:freetype psprint rsc sot ucbhelper unotools icu i18npool unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx SNDFILE:sndfile PORTAUDIO:portaudio transex3 SO:officenames NULL
+vc	vcl	:	BOOST:boost NAS:nas FREETYPE:freetype psprint rsc sot ucbhelper unotools ICU:icu i18npool unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx SNDFILE:sndfile PORTAUDIO:portaudio transex3 SO:officenames NULL
 vc	vcl										usr1	-	all	vc_mkout NULL
 vc	vcl\source\glyphs						nmake	-	all	vc_glyphs NULL
 vc	vcl\source\app							nmake	-	all	vc_app NULL
