-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart quotes shouldn't break the pyxform #85
Comments
Any objections to replacing all of these smart characters with their simpler equivalents? |
I personally don't mind, but a lot of design people really like smart quotes. |
Smart quotes are not supported in XPath 1.0 as far as I know, so replacing might be the only way. See in browser javascript console: document.evaluate('string("o")', document.documentElement, document.createNSResolver(document.documentElement), XPathResult.STRING_TYPE, null).stringValue versus: document.evaluate('string(‘o’)', document.documentElement, document.createNSResolver(document.documentElement), XPathResult.STRING_TYPE, null).stringValue |
Pretty compelling evidence :) Sounds like replacing is the right way to go. |
I'll write a test of this change. |
Should smart quotes in labels be simplified as well? Or just I'll aim to replace all |
All fancy quote characters in any field in the survey sheet will be replaced. This change does not touch the |
I think you should replace smart quotes everywhere. Settings has form_title and version and what you enter there will show up in the XML. Ditto with the names and labels in the choices. |
Replace smart quotes in form, closes #85
@yanokwa Why do we need to replace all the smart quotes everywhere? Should we consider about this replace function will change the user's real content in the Form? Like label and hint? |
The smart quotes are used in Chinese, I guess other languages also use smart quotes often. Therefore, this conversion may affect the survey content of some multiple-language surveys. |
@yixi8524 @fendiaoxiaoshuazi if you are interested in exploring a way to maintain smart quotes within strings and hints, please consider opening a PR! Please verify output with the latest releases of both ODK Collect and Enketo Express. |
Works: selected(${branch}, 'o')
Doesn't work: selected(${branch}, ‘o’)
test.xlsx
It'd be good if smart quotes were allowed in labels, but I don't know how this plays with UTF-8 and the XML spec and JavaRosa.
The text was updated successfully, but these errors were encountered: