Skip to content

fix: convert wa-row voiced kana (U+30F8/U+30F9) in toHiraganaCase and toKatakanaCase#62

Merged
polygonplanet merged 1 commit into
polygonplanet:masterfrom
greymoth-jp:fix-wa-row-voiced-kana
Jul 2, 2026
Merged

fix: convert wa-row voiced kana (U+30F8/U+30F9) in toHiraganaCase and toKatakanaCase#62
polygonplanet merged 1 commit into
polygonplanet:masterfrom
greymoth-jp:fix-wa-row-voiced-kana

Conversation

@greymoth-jp

Copy link
Copy Markdown
Contributor

toHiraganaCase and toKatakanaCase already handle two of the four wa-row voiced katakana: (U+30F7) is decomposed to わ゛ and (U+30FA) to を゛, and toKatakanaCase composes them back. The other two, (U+30F8) and (U+30F9), were left out, so they pass through unconverted:

Encoding.toHiraganaCase('ヷヸヹヺ');      // 'わ゛ヸヹを゛'  (ヸ/ヹ unchanged)
Encoding.toKatakanaCase('わ゛ゐ゛ゑ゛を゛'); // 'ヷヰ゛ヱ゛ヺ'  (ゐ゛/ゑ゛ not composed)

The base letters / already convert to / through the usual katakana/hiragana offset, so the voiced forms now follow the same pattern as /:

Encoding.toHiraganaCase('ヷヸヹヺ');      // 'わ゛ゐ゛ゑ゛を゛'
Encoding.toKatakanaCase('わ゛ゐ゛ゑ゛を゛'); // 'ヷヸヹヺ'

Added a test covering the round-trip for the full wa-row voiced family. npm test passes.

toHiraganaCase already decomposes ヷ (U+30F7) to わ゛ and ヺ (U+30FA) to を゛,
and toKatakanaCase composes them back, but the other two wa-row voiced
katakana ヸ (U+30F8) and ヹ (U+30F9) were left out and passed through
unconverted. The base letters ヰ/ヱ already map to ゐ/ゑ, so the voiced forms
now follow the same pattern: ヸ <=> ゐ゛, ヹ <=> ゑ゛.
@polygonplanet

Copy link
Copy Markdown
Owner

@greymoth-jp
Thank you for the thoughtful PR!
I didn't realize that ヸ (U+30F8) and ヹ (U+30F9) were missing. The tests are thorough too, which is a big help. I will go ahead and merge this. Thank you!

@polygonplanet polygonplanet merged commit 383bab8 into polygonplanet:master Jul 2, 2026
6 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.

2 participants