Optionally use libunistring or libicu to provide Unicode data
Submitted by Philip Withnall
GLib currently has around 1MB of Unicode tables loaded in memory for providing character information. That memory is shared between all processes, so the hit is not large, but for smaller devices it’s still a bit of a problem.
Given that libicu and libunistring are widely available on Linux, and loaded by gnome-shell, WebKit, flatpak helpers, gnome-builder, amongst others (see
sudo grep libunistring /proc/*/maps), we could consider using one of them (if available) to provide character information.
On really small embedded devices, people seem to want to drop the Unicode data from GLib entirely. I don’t know if a platform-specific replacement is available (does uclibc have the right data?). I suspect dropping it entirely from GLib will break too many functions at runtime. We could look at making sure it’s optimised out by -fdata-sections -ffunction-sections -Wl,--gc-sections if unused.