Add optional iconv-extra layer for legacy character encodings - #671
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
iconv-extraLambda layer containing the glibc conversion modules that are present in the Bref build image but omitted from the slim runtime image.Applications can attach the layer when they need legacy character encodings such as Windows-1250, without increasing the size of every Bref runtime.
Fixes: brefphp/bref#2145
Usage
GCONV_PATHmust be set before PHP starts so glibc can discover the modules under/opt/lib/gconv.Reproduction
Without the layer, this conversion fails in the Bref PHP 8.3 runtime:
With the layer and
GCONV_PATH=/opt/lib/gconv, it returnsőűÁÉ.The issue also reproduces through Microsoft ODBC/PDO_SQLSRV when fetching a SQL Server
varcharcolumn using a Windows-1250 collation. The query fails withUnicode conversion failedwithout the layer and succeeds with it.Size impact
Measured for PHP 8.3/x86-64:
Keeping this optional avoids adding that size to applications that only use UTF-8/Unicode encodings.
Validation
layer=iconv-extra php_versions=83 make test layer=iconv-extra php_versions=83 make layers