开发者

How can I force ASCII only urls in Drupal?

开发者 https://www.devze.com 2023-03-31 12:10 出处:网络
in a Drupal 7 with PathAuto website: In pathAuto settings I have something like \"[term:vocabulary]/[term:name]\" as a pattern in many categories, but because the vocabulary, taxonomy, etc names are

in a Drupal 7 with PathAuto website:

In pathAuto settings I have something like "[term:vocabulary]/[term:name]" as a pattern in many categories, but because the vocabulary, taxonomy, etc names are not in English I have urls that contain non ascii characters. T开发者_JS百科his is not bad but in IE is ugly (something like Portal/%CE%B5%CE%BC%CE%B2%CE etc.

I could use the machine name instead of the name or vocabulary, but I want something better.

In wordpress there are plugins that sanitize the url and I am using them in order to replace non ascii with ascii characters (eg α -> a, π -> p in greek, and so on)

How can I have such behavior in Drupal?


The solution is the Transliteration module.

Provides one-way string transliteration (romanization) and cleans file names during upload by replacing unwanted characters.

Generally spoken, it takes Unicode text and tries to represent it in US-ASCII characters (universally displayable, unaccented characters) by attempting to transliterate the pronunciation expressed by the text in some other writing system to Roman letters.

The module is supported by the PathAuto module.

For Pathauto 6.x-2.x: Transliteration is useful if your site is likely contain characters beyond ASCII 128 and you want them transliterated into ASCII 128. (For Pathauto 6.x-1.x that feature is handled by the Pathauto module, see the README.txt for more details).

0

精彩评论

暂无评论...
验证码 换一张
取 消