Opened 13 years ago
Closed 12 years ago
#20772 closed defect (bug) (fixed)
remove_accents() improvements for Chinese pinyin permalinks
Reported by: | bolo1988 | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.3.2 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
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
@
13 years ago
#2
@
13 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
@
13 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 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: