diff --git a/Readme.md b/Readme.md index 5a8eff34..d8d137fb 100644 --- a/Readme.md +++ b/Readme.md @@ -70,6 +70,7 @@ functions: | Igbinary | `${bref-extra:igbinary-php-81}` | | Imagick | `${bref-extra:imagick-php-81}` | | IMAP | `${bref-extra:imap-php-81}` | +| Iconv Extra | `${bref-extra:iconv-extra-php-81}` | | LDAP | `${bref-extra:ldap-php-81}` | | Mailparse | `${bref-extra:mailparse-php-81}` | | MaxMind DB | `${bref-extra:maxminddb-php-81}` | @@ -105,6 +106,17 @@ functions: | xmlrpc | `${bref-extra:xmlrpc-php-81}` | | Yaml | `${bref-extra:yaml-php-81}` | +### Iconv Extra setup + +The Iconv Extra layer provides additional glibc conversion modules for legacy character encodings, +such as Windows-1250. Set `GCONV_PATH` in `serverless.yaml` so glibc can find the modules before PHP starts: + +```yaml +provider: + environment: + GCONV_PATH: /opt/lib/gconv +``` + ### Blackfire installation The Blackfire layer only have the probe installed. diff --git a/layers/iconv-extra/Dockerfile b/layers/iconv-extra/Dockerfile new file mode 100644 index 00000000..64c5d376 --- /dev/null +++ b/layers/iconv-extra/Dockerfile @@ -0,0 +1,8 @@ +ARG PHP_VERSION +ARG BREF_VERSION + +FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext + +FROM scratch + +COPY --from=ext /usr/lib64/gconv/ /opt/lib/gconv/ diff --git a/layers/iconv-extra/config.json b/layers/iconv-extra/config.json new file mode 100644 index 00000000..205ba218 --- /dev/null +++ b/layers/iconv-extra/config.json @@ -0,0 +1,8 @@ +{ + "php": [ + "82", + "83", + "84", + "85" + ] +} diff --git a/layers/iconv-extra/test.php b/layers/iconv-extra/test.php new file mode 100644 index 00000000..3980ebc5 --- /dev/null +++ b/layers/iconv-extra/test.php @@ -0,0 +1,11 @@ +