symfony

symfony/polyfill-iconv

PHP MIT Dev Tools

Symfony polyfill for the Iconv extension

1.8k stars
10 forks
slow
GitHub

1.8k

Stars

10

Forks

0

Open issues

21

Contributors

v1.34.0 11 Apr 2026

AI Analysis

This Symfony component provides a native PHP implementation of the iconv character encoding conversion functions, serving as a fallback when the native iconv extension is unavailable. It is specialized for developers maintaining PHP applications that require cross-platform character encoding support, particularly useful in environments where the iconv extension cannot be installed. This tool is not for general-purpose web development but rather for library authors and framework developers who...

Dev Tools Library Discovery value: 3/10
Documentation 7/10
Activity 8/10
Community 7/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

polyfill character-encoding php-compatibility iconv symfony-component
Actively maintained MIT licensed Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
1w ago

PHP polyfill for iconv character encoding functions, maintained as part of Symfony's ecosystem

symfony/polyfill-iconv provides a pure PHP implementation of PHP's native iconv extension functions, enabling character encoding conversion on systems where the iconv extension is unavailable or disabled. It is part of Symfony's polyfill suite—a collection of standardized fallbacks for missing PHP extensions. Adoption appears concentrated within the Symfony ecosystem and projects that depend on Symfony components. Real-world adoption metrics are not publicly documented.

Origin

Created in October 2015 as part of Symfony's broader polyfill initiative to address missing or inconsistent PHP extensions across hosting environments. The polyfill suite emerged from Symfony's goal of providing portable, dependency-light components that work across diverse PHP configurations.

Growth

1,761 stars indicates modest, stable presence within the PHP ecosystem. Growth has been flat relative to sibling polyfills (e.g., polyfill-mbstring has 7,830 stars), suggesting this solves a less common gap than multibyte string handling. Last commit in April 2026 indicates ongoing, though not frequent, maintenance.

In production

Adoption not verified. The project is part of the official Symfony organization and likely used transitively by projects requiring Symfony components, but explicit production usage, case studies, or adoption figures are not documented in the README or public metadata.

Code analysis
Architecture

Based on README, this appears to be a thin wrapper around iconv's core character conversion functions. The README notes it does not implement `ob_iconv_handler` (output buffering integration), suggesting selective scope. Likely implements functions like `iconv()`, `iconv_get_encoding()`, and `iconv_set_encoding()` as pure PHP or through fallback mechanisms.

Tests

Not documented in provided README excerpt. Test coverage details are not available.

Maintenance

Last push on 2026-04-26 (approximately 67 days before evaluation date) indicates the project is actively maintained but not under continuous active development. No zero-stars-in-7-days signal suggests low churn. Maintenance appears reactive rather than feature-driven.

Honest verdict

ADOPT IF: your application requires character set conversion beyond UTF-8, you use Symfony components, and you need to ensure compatibility on servers without the iconv extension installed. AVOID IF: your primary need is UTF-8 handling (use polyfill-mbstring instead), you have control over your hosting environment and can require the native iconv extension, or you do not depend on Symfony. MONITOR IF: you maintain a library that must support environments without iconv and you want to assess whether this mature, maintained polyfill reduces your own maintenance burden.

Independent dimensions

Mainstream potential

2/10

Technical importance

5/10

Adoption evidence

2/10

Risks
  • Narrow scope: solves character set conversion, but only when iconv extension is absent. If the extension is available (common on most hosting), this polyfill adds unused code.
  • Performance: pure PHP fallback will be significantly slower than native C-based iconv extension. Not suitable for high-throughput encoding tasks.
  • Incomplete scope: README explicitly notes `ob_iconv_handler` is not implemented, limiting use cases involving output buffering stream handlers.
  • Limited adoption transparency: no documented real-world usage metrics, case studies, or community feedback makes it difficult to assess how widely this is relied upon beyond Symfony itself.
  • Dependency lock-in: adopting this as a dependency couples your project to Symfony's maintenance and versioning decisions for a relatively narrow function.
Prediction

Likely to remain a niche utility within the Symfony ecosystem, maintained indefinitely but not seeing significant growth. Adoption will remain tied to Symfony's ecosystem growth and the ongoing prevalence of legacy character set conversion requirements.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
100%

Information

Language
PHP
License
MIT
Last updated
2mo ago
Created
130mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Open issues

No open issues — clean slate.

Open pull requests

Similar repos

symfony

symfony/polyfill-intl-icu

This package provides fallback implementations of PHP's Intl extension for...

2.6k PHP Dev Tools
symfony

symfony/polyfill-intl-idn

This Symfony polyfill provides PHP implementations of `idn_to_ascii` and...

3.4k PHP Dev Tools
symfony

symfony/polyfill-intl-normalizer

This Symfony component provides a fallback implementation of PHP's Normalizer...

2.1k PHP Dev Tools
symfony

symfony/polyfill

Symfony Polyfill provides PHP compatibility layers and backports for features...

2.8k PHP Dev Tools
symfony

symfony/polyfill-util

Symfony Polyfill / Util provides PHP utilities for ensuring code portability...

1.3k PHP Dev Tools
vs. alternatives
symfony/polyfill-mbstring

7,830 stars vs. 1,761. Multibyte string handling solves a broader, more common problem (UTF-8 handling in legacy environments). iconv targets a narrower use case (character set conversion beyond just UTF-8).

symfony/polyfill-intl-normalizer

2,072 stars vs. 1,761. Similar scope (text encoding/normalization). Intl-normalizer likely addresses a more standardized, widely-expected need (Unicode normalization) than iconv's broader conversion capability.

symfony/polyfill-ctype

4,043 stars vs. 1,761. Ctype (character type classification) appears more universally needed than iconv. Iconv is often used only when legacy character set migration is required.

iconv PECL extension

Canonical solution. Polyfill-iconv is a fallback for environments where the PECL/native iconv extension is unavailable, not a replacement for the native implementation.

mb_convert_encoding (mbstring)

Alternative for UTF-8 conversion. Many projects use mbstring's functions instead of iconv when available, as mbstring is more commonly installed. Iconv targets character sets beyond UTF-8.