System.out.println will print to the default logger. Unless you are viewing 
the logs in a context which supports unicode, you might see the '?' char. 
This is my guess as to the first issue. As to the second issue of the 
error, if you read the error text, it seems to suggest that you are running 
into the problem of not setting the environment variable in your 
environment as well as in appengine-web.xml, as this doc says they should 
be set 
<https://cloud.google.com/appengine/docs/java/config/appconfig#Java_appengine_web_xml_System_properties_and_environment_variables>
 
when running dev-server.

On Friday, January 15, 2016 at 11:29:45 AM UTC-5, Hung Ha wrote:
>
> I am building my app in Google App Engine
>
> Ok, here I got a Servlet
>
> public void doPost(HttpServletRequest req, HttpServletResponse resp)
>         throws IOException {
>      String firstName=req.getParameter("firstName");
>      System.out.println(URLDecoder.decode(firstName, "UTF-8")+" "+ firstName);
>   }
>
> Now, I sent "Thá»§y" to the Servlet and it shows this output
>
> th?y th?y
>
> Then, I set up appengine-web.xml
>
> <appengine-web-app>.......
>  <env-variables>
>     <env-var name="DEFAULT_ENCODING" value="UTF-8" />
>   </env-variables>
> </appengine-web-app>
>
> Then when running i got this error:
>
> com.google.appengine.tools.development.EnvironmentVariableChecker$IncorrectEnvironmentVariableException:
>  One or more environment variables have been configured in appengine-web.xml 
> that have missing or different values in your local environment. We recommend 
> you use system properties instead, but if you are interacting with legacy 
> code that requires specific environment variables to have specific values, 
> please set these environment variables in your environment before running.
> [Mismatch environmentVariableName=DEFAULT_ENCODING 
> environmentVariableValue=null appEngineWebXmlValue=UTF-8 
> appEngineWebXmlFile=C:\Users\henry\workspace8\FluentEnglish\war\WEB-INF\appengine-web.xml]
>     at 
> com.google.appengine.tools.development.EnvironmentVariableChecker.check(EnvironmentVariableChecker.java:75)
>     at 
> com.google.appengine.tools.development.ApplicationConfigurationManager.checkEnvironmentVariables(ApplicationConfigurationManager.java:240)
>     at 
> com.google.appengine.tools.development.ApplicationConfigurationManager.access$000(ApplicationConfigurationManager.java:32)
>     at 
> com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.checkEnvironmentVariables(ApplicationConfigurationManager.java:394)
>     at 
> com.google.appengine.tools.development.JettyContainerService.connectContainer(JettyContainerService.java:211)
>     at 
> com.google.appengine.tools.development.AbstractContainerService.createConnection(AbstractContainerService.java:273)
>     at 
> com.google.appengine.tools.development.AbstractInstanceHolder.createConnection(AbstractInstanceHolder.java:37)
>     at 
> com.google.appengine.tools.development.AbstractModule.createConnection(AbstractModule.java:73)
>
> So, *what's wrong?*
>
> *Why doesn't HttpServletRequest show Unicode Text?*
>
> *How to make HttpServletRequest show Unicode Text?*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/09aa155e-a613-4c2c-9d15-c1c7dfe76a44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to