Hi Cheng-Chang,
I've made sure that the HTTP part and the app engine storage part work
with multi-byte Unicode characters, for example here:
http://hensotest.appspot.com/Ng/
What I haven't tested (and what's obviously causing the problems) is
having multi-byte characters in the application code. There are two
possible reasons I can think of: Either the the appcfg utility messes
the characters up during the deployment, or Helma NG uses the wrong
encoding to read the code.
After some testing, it looks like app engine just doesn't support
Unicode for deployed source code. The app engine nodes report
ANSI_X3.4-1968, which according to Wikipedia seems to be another name
for plain ASCII, and all my attempts to force UTF-8 encoding (like
setting the java "file.encoding" system property to "UTF-8") didn't
change anything.
What you could do as a workaround is to encode your strings using the
"\uxxxx" syntax, with xxxx being the hexadecimal UTF-16 character
code. The following code snippet shows how to escape any string to
that format:
helma> var str = "歡迎光臨 Helma NG";
helma> Array.map(str, function(c) {
> var cc = c.charCodeAt(0);
> return cc < 128 ? c : '\\u' + c.charCodeAt(0).toString(16);
> }).join('');
\u6b61\u8fce\u5149\u81e8 Helma NG
helma> "\u6b61\u8fce\u5149\u81e8 Helma NG"
歡迎光臨 Helma NG
helma> "\u6b61\u8fce\u5149\u81e8 Helma NG" === str
true
Hannes
2009/7/14 ccwu <
ccwu6...@gmail.com>: