title: Character encoding in web applicaion running on Websphere Application Server 8.5
body: <p>I have a problem with Cyrillic symbols represention (they looks as '0B0;lO') in IBM WebSphere Application I created.</p>
  
  <p>So I use WebSphere 8.5 (Unix Red Hat) and application is a java-servlet which listens to HTTP POST Requests. </p>
  
  <p>JVM properties on WebSphere are:</p>
  
  <ul>
  <li><p>Default Charset=UTF-8</p></li>
  <li><p>Default Charset= in use=UTF-8</p></li>
  <li><p>file.encoding=UTF-8</p></li>
  </ul>
  
  <p>I have checked file encoding.properties and set encoding to UTF8. Requests to my application I send in UTF8 by following code:</p>
  
  <pre><code>   HttpURLConnection connection = (HttpURLConnection)url.openConnection();
     connection.setRequestMethod("POST"); 
     connection.setRequestProperty("Accept-Charset", "UTF-8");
     connection.setRequestProperty("Content-Type", "text/plain; charset=UTF-8");
     connection.setRequestProperty("Content-Length", Integer.toString(resultXML.getBytes().length));
     connection.setUseCaches (false);
     connection.setDoInput(true);
     connection.setDoOutput(true);
  
     //Send request
     DataOutputStream wr = new DataOutputStream (
               connection.getOutputStream ());
    // BufferedWriter br = new BufferedWriter(new OutputStreamWriter(wr, "UTF-8"));
     BufferedWriter br1 = new BufferedWriter(new OutputStreamWriter(wr, Charset.forName("UTF-8")));
     br1.write(resultXML);
     br1.close();
     wr.flush ();
     wr.close ();
  
     //Get Response
     BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
     String line;
     while ((line = rd.readLine()) != null) {
        System.out.println(line);
     }
     rd.close();
  </code></pre>
  
  <p>In application HTTP Request Handler first of all I set encoding by:</p>
  
  <pre><code>        response.setCharacterEncoding("UTF-8");
  
          request.setCharacterEncoding("UTF-8");
  </code></pre>
  
  <p>But all Cyrillic symbols in request and response looks uncorrectly and when appplication put them to Oracle DB or simply to response these symbols have wrong view.</p>
  
  <p>Help with problem, please!</p>