Opened 14 years ago
Closed 14 years ago
#20772 closed defect (bug) (fixed)
remove_accents() improvements for Chinese pinyin permalinks
| Reported by: | bolo1988 | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | I18N | Version: | 3.3.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
echo str_replace(' ', '-', str_replace('.', '', sanitize_file_name(remove_accents(strtolower('Lǚcì')))));
the result:
lǚcì
and i found remove_accents() can't convert the following chars:
ǎ -> a
ǒ -> o
ǚ -> v/u
ǐ -> i
ǔ -> u
Attachments (2)
Change History (7)
#1
in reply to: ↑ description
@
14 years ago
#2
@
14 years ago
$pinyin_in = array( chr(199).chr(142) => 'a', chr(199).chr(144) => 'i', chr(199).chr(146) => 'o', chr(199).chr(148) => 'u', chr(199).chr(154) => 'u', ); $output = str_replace(array_keys($pinyin_in), $pinyin_in, $string);
This code can fixed the problem
#3
@
14 years ago
- Keywords has-patch added
- Milestone Awaiting Review → Future Release
20772.patch adds the missing Pinyin diacritics to the replacement list.
Unit tests: [UT724]
Note:
See TracTickets
for help on using tickets.
Replying to bolo1988: