Sorry typo of subject, it should be: Rules for creating a url alias after node created not support chinese character
here is the rule
{ "rules_interview_alias" : {
"LABEL" : "interview_alias",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "path" ],
"ON" : [ "node_insert" ],
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : { "interview" : "interview" } }
}
}
],
"DO" : [
{ "node_path_alias" : { "node" : [ "node" ], "alias" : "[node:nid][node:title].html" } }
]
}
}
if node:title contains chinese character, the final url will be [node:nid].html, [node:title] is skipped
How do solved this problem?
Comments
Comment #1
hkvega01 commentedComment #2
ptmkenny commentedDoes the [node:title] token properly output Chinese characters?
Can you normally create URLs with aliases that contain Chinese characters on your site?
Comment #3
hkvega01 commentedDoes the [node:title] token properly output Chinese characters?
>>really don't know
Can you normally create URLs with aliases that contain Chinese characters on your site?
>>YES, but not using rules
Comment #4
ptmkenny commentedTry adding another action to the rule, "Show message on site," and set the message to "[node:nid][node:title].html" and check what is output. Also, enable the rules debug log and give permission to view the debug log results and see what that outputs.
Comment #4.0
ptmkenny commentedtypo of subject
Comment #5
tr commentedBy default, the node_path_alias action uses transliteration (if the transliteration module is available) then replaces all non-ASCII characters with a "-", but this can be changed.
Go to /admin/config/workflow/rules/settings and you will see an option "URL Path cleaning method". The default value is "Rules (built-in) which
replaces non-ASCII characters like I describe above. But if you use "Pathauto" (requires Pathauto module) as your path cleaning method, then it will properly display Chinese characters.
Note, this is NOT a problem with Tokens - they will work properly with Chinese characters in most contexts. But a path is special, and the character set for paths is restricted by the HTTP protocol (and was far more restricted on the internet when this code was first written), which is why there is a "cleaning function".
Because you can configure this to work, I don't consider it a bug. Perhaps the default Rules path cleaning function should be brought up to current web standards for which characters can and cannot appear in a path.