Skip to content

i18l: Error on Unicode keys, regex to soften. #433

@hugolpz

Description

@hugolpz

A test shown that Handlebar.js fails to handle unicode keys [1]. (Mustache.js works fine.) Chinese, Japanese, arabic, indian, korean characters are concerned. A Stackoverflow answer[3] noticed that Handlebars source use regexes like [a-zA-Z]+ and [a-zA-Z0-9_$-]+/[=}\s/.] to drive the keys parsing. It is suspect that this rather limited a-zA-Z components are behind your trouble.

Question: which regex should be used ? Can someone check and submit a codefix ?

[1]: http://jsfiddle.net/YqhKG/2/ -- handlebar test: fail.
[2]: -- mustache.js test: works fine.
[3] http://stackoverflow.com/questions/14661526/handlebars-js-doesnt-handle-unicode-as-jsons-key

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions