Skip to content

[PHP] Match canonical Unicode source paths - #586

Open
adamziel wants to merge 1 commit into
trunkfrom
codex/cautious-unicode-source-path-normalization
Open

[PHP] Match canonical Unicode source paths#586
adamziel wants to merge 1 commit into
trunkfrom
codex/cautious-unicode-source-path-normalization

Conversation

@adamziel

Copy link
Copy Markdown
Collaborator

Matches configured Unicode source paths in composed and decomposed form.

For this mapping:

https://source.example/café => https://destination.example/assets

both /café/logo.png and /café/logo.png become /assets/logo.png. The matcher adds literal NFC and NFD alternatives to its source pattern. It still replaces the bytes found in the original text, so bytes after the source base retain their original spelling.

Source paths may now contain valid UTF-8 without whitespace or control characters. Unicode domains and Unicode destination paths remain unsupported. Compatibility normalization remains out of scope, so and fi stay distinct.

PHP’s parse_url() changes some control-valued bytes to underscores. A UTF-8 continuation byte can have one of those values, as the combining accent in decomposed é does. The source path is therefore sliced from the configured URL before normalization. The Symfony normalizer polyfill keeps this behavior available when ext-intl is absent.

Testing

The URL-rewriting suite covers NFC-to-NFD and NFD-to-NFC matching, exact Unicode paths, compatibility characters, invalid UTF-8, and the existing cautious URL cases.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Pull pipeline performance — large-directory

Site: large-directory · 2,000+ plus targeted file-transfer scenarios files · 10,000 posts · 25,000 postmeta · PHP 8.5.9

Stage PR trunk Δ Status Details
playground-sqlite-db-pull 9.76 s 9.31 s ⚪ +450 ms (+4.8%) condition=db-pull in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=lexer
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=selected
trunk: condition=db-pull in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=lexer
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=selected
playground-sqlite-db-apply 3.79 s 3.79 s ⚪ +1 ms (+0.0%) condition=db-apply to SQLite in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=parser
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=verified
native_ast=WP_MySQL_Native_Parser_Node
sqlite_driver_parser=verified
trunk: condition=db-apply to SQLite in PHP.wasm
runtime=php.wasm 8.3
wp_mysql_parser=enabled
mode=parser
native_lexer=verified
native_token_stream=WP_MySQL_Native_Token_Stream
native_token_count=18
native_parser=verified
native_ast=WP_MySQL_Native_Parser_Node
sqlite_driver_parser=verified
Total 13.55 s 13.10 s ⚪ +451 ms (+3.4%)

Numbers carry runner noise; treat single-run deltas as directional, not authoritative.

📈 Trunk performance history — commit-by-commit timeline.

@adamziel
adamziel force-pushed the codex/cautious-unicode-source-path-normalization branch from 63c598a to 555316d Compare August 13, 2026 23:51
@adamziel
adamziel changed the base branch from codex/cautious-target-ports to trunk August 13, 2026 23:51
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