Skip to content

Fix mixed-script values in the ru_RU company name lists - #1067

Open
a-vasyukov wants to merge 1 commit into
FakerPHP:2.0from
a-vasyukov:fix/ru-company-mixed-scripts
Open

Fix mixed-script values in the ru_RU company name lists#1067
a-vasyukov wants to merge 1 commit into
FakerPHP:2.0from
a-vasyukov:fix/ru-company-mixed-scripts

Conversation

@a-vasyukov

Copy link
Copy Markdown

What is the reason for this PR?

  • A new feature
  • Fixed an issue

Three values in src/Provider/ru_RU/Company.php mix scripts:

Value Problem
'-H' ($companyNameSuffixes) Latin H (U+0048) instead of Cyrillic Н (U+041D)
'Cиб' ($companyElements) Latin C (U+0043) instead of Cyrillic С (U+0421)
'IT' ($companyElements) Latin inside an otherwise Cyrillic list

Company names are assembled without separators
({{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameSuffix}}), so each of
these produces a mixed-script word: Хмель-H, CибМаш, ITМонтаж. Such strings do not match a
search for their Cyrillic spelling and sort incorrectly — Cиб is never found by Сиб. Each value
lands in roughly 3.6% of generated company names.

'IT' is wrong as data too: a Russian company's registered name is written in Russian, and foreign
words may only appear in Cyrillic transcription, so Russian IT companies are registered as АйТи,
never as IT.

This re-submits the fix from #882, which was approved twice but closed by the stale bot on
2025-05-06, and extends it to the other two values.

Author's checklist

Summary of changes

  • '-H''-Н', 'Cиб''Сиб', 'IT''АйТи'
  • add a test asserting that both name lists contain no Latin characters

Regarding "avoid changing existing sets of data": no element is added, removed or reordered, so a
given seed still selects the same positions in the same order. Only the characters inside three
values change — the very characters that are the defect.

The suite stays green: 1416 tests before, 1417 with the new test, no failures.

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

Three values in the ru_RU Company provider mix Latin and Cyrillic letters:
'-H' and 'Cиб' hold Latin homoglyphs, and 'IT' is Latin inside an otherwise
Cyrillic list. Company names are assembled without separators, so each of
them yields mixed-script words such as "Хмель-H", "CибМаш" or "ITМонтаж",
which break search and sorting for anyone using the ru_RU locale.
@a-vasyukov

Copy link
Copy Markdown
Author

Pinging before the stale bot reaches this one — the fix it re-submits (#882) was approved twice and
then closed by that same bot.

If 'IT''АйТи' is what's holding it up, I'll split it out: '-H' and 'Cиб' are plain
Latin-in-Cyrillic typos, 'IT' is a judgement about the data. Say the word and the two homoglyphs
land on their own.

CI has never run here — outside contributors need manual approval.

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