Skip to content

Support portable-ascii 1.x on 8.0.x - #17

Merged
MoamenEltouny merged 2 commits into
8.0.xfrom
feature/portable-ascii-1-8.0.x
Oct 7, 2026
Merged

MoamenEltouny merged 2 commits into
8.0.xfrom
feature/portable-ascii-1-8.0.x

Conversation

@MoamenEltouny

Copy link
Copy Markdown
Member

Allows voku/portable-ascii 1.x on the 8.0.x line (^1.6.1 || ^2.0), for release as 8.0.4.

Laravel 7 and 8 require portable-ascii 1.x, while every 8.x line of this package required 2.x, so pharaonic/php-slugify could not be installed next to them. This blocks pharaonic/laravel-sluggable 7.x and 8.x.

Same output with 1.x and 2.x

Comparing every BMP letter (49,638) across every portable-ascii language, 1.x and 2.x differ on only a few letters:

  • Generic table: Persian پ (b instead of p) and the Cyrillic ё ъ ы э ю я. 1.x also turns э into e', which split words: Мэр gave me-r.
  • Language maps: fa (پ, ج), uk (16 letters, already covered by the Ukrainian override) and latin (4 letters).

When 1.x is installed, PortableAsciiTransliterator replaces those letters with the 2.x result before calling portable-ascii. Generic replacements are skipped where the language has its own entry, so ru keeps yolka. The table lives in src/Resources/portable-ascii-1.php. Detection is a single cached check (پ → b only on 1.x), and nothing changes when 2.x is installed.

After the change, the same comparison gives 0 differences, and the test suite (including the locale corpus) passes on both 1.6.1 and 2.1.1. The CI lowest dependency jobs now run on 1.6.1.

Note on portable-ascii 2.1

portable-ascii 2.1 has a fast path for strings up to 64 bytes that gives different results from its full path on longer strings when no locale is set (ёлка + 40 letters → elka, + 60 letters → iolka). This change matches the per-letter results, which is also what the corpus expects. With 1.x, the result no longer depends on the string length.

The CHANGELOG has an 8.0.4 entry, and the installation docs list both versions.

@MoamenEltouny MoamenEltouny self-assigned this Oct 7, 2026
@MoamenEltouny
MoamenEltouny merged commit e6d925a into 8.0.x Oct 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant