Skip to content
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

Encoding non-ASCII variables for generator #19

Closed
GoogleCodeExporter opened this issue Dec 6, 2015 · 2 comments
Closed

Encoding non-ASCII variables for generator #19

GoogleCodeExporter opened this issue Dec 6, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. use some non-ASCII word as variable
2. the generated code shows '__' instead of the non-ASCII word

approach:

We can use 'encodeURI' to escape non-ASCII variables to ASCII code

== get ==

from 

variableDB_.getName(this.getTitleText(1)

to 

variableDB_.getName(encodeURI(this.getTitleText(1))

== set ==

from 

variableDB_.getName(this.getTitleText(1)

to 

variableDB_.getName(encodeURI(this.getTitleText(1))

Original issue reported on code.google.com by gasolin on 9 Jun 2012 at 6:38

@GoogleCodeExporter
Copy link
Author

BTW the ASCII variable will not change after apply this patch. 

Note that the generated variable is not exactly the non-ASCII variables, but a 
'A1_B3_12' style variable.

Since python(2.x) and other language may not support non-ASCII variables 
natively, a 'A1_B3_12' style variable might be the best compromised choice.

Original comment by gasolin on 9 Jun 2012 at 7:25

@GoogleCodeExporter
Copy link
Author

Good call.  I've added this to names.js so that it applies to all the places 
where variables are used, as well as function names.  Revision 226.  Pushed to 
Subversion, and will be in the next production push.

Original comment by neil.fra...@gmail.com on 9 Jun 2012 at 8:06

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant