Adds a minimal ICU data config for Flutter

This reduces the size of the ICU data file shipping with Flutter:
 from 6.3MB to 1.2MB uncompressed
 from 2.2MB to 534KB compressed (zip)

See go/flutter-icu for detailed analysis.

Change-Id: Iff5a4aa5286c685d5410b28d98ac8d49987d2eef
Reviewed-by: Jungshik Shin <>
diff --git a/ b/
index f69d500..c782db0 100644
--- a/
+++ b/
@@ -96,6 +96,8 @@
       # certain preprocessor defines are set.
       # unistr.cpp also has an unused function for non-component builds.
+      # putil.cpp contains unused variables when building for iOS simulators.
+      "-Wno-unused-variable",
   if (is_clang || is_linux || is_android) {
diff --git a/README.chromium b/README.chromium
index 092245c..287215f 100644
--- a/README.chromium
+++ b/README.chromium
@@ -77,7 +77,9 @@
      ix) Repeat ii) and iii) for iOS to get ios/icudtl.dat
-     x) scripts/
+     x) Repeat ii) and iii) for Flutter to get flutter/icudtl.dat
+     xi) scripts/
      This reverts the result of and and
      make the tree ready for committing updated ICU data files for
diff --git a/flutter/flutter-removed-resources.txt b/flutter/flutter-removed-resources.txt
new file mode 100644
index 0000000..b600da1
--- /dev/null
+++ b/flutter/flutter-removed-resources.txt
@@ -0,0 +1,427 @@
+# lang/*
+# misc/ (note mising *, only partly removed)
+# *.cnv
+# other
diff --git a/flutter/icudtl.dat b/flutter/icudtl.dat
new file mode 100644
index 0000000..91d0b16
--- /dev/null
+++ b/flutter/icudtl.dat
Binary files differ
diff --git a/scripts/ b/scripts/
index a8def76..e83496e 100755
--- a/scripts/
+++ b/scripts/
@@ -54,6 +54,21 @@
   echo "Done with copying pre-built ICU data file for $1."
+function copy_flutter {
+  echo "Copying icudtl.dat for Flutter"
+  cp "data/out/tmp/icudt${VERSION}l.dat" "${TOPSRC}/flutter/icudt${VERSION}l.dat"
+  echo "Removing unused resources from icudtl.dat for Flutter"
+  LD_LIBRARY_PATH=lib/ bin/icupkg -r \
+    "${TOPSRC}/flutter/flutter-removed-resources.txt" \
+    "${TOPSRC}/flutter/icudt${VERSION}l.dat"
+  mv "${TOPSRC}/flutter/icudt${VERSION}l.dat" "${TOPSRC}/flutter/icudtl.dat"
+  echo "Done with copying pre-built ICU data file for Flutter."
 case "$1" in
@@ -67,4 +82,7 @@
     copy_cast Cast cast
+  "flutter")
+    copy_flutter
+    ;;
diff --git a/scripts/ b/scripts/
index 557fbdc..a1c2bcc 100755
--- a/scripts/
+++ b/scripts/
@@ -16,5 +16,6 @@
 $ICUROOT/scripts/ ios
+$ICUROOT/scripts/ flutter