title: httpurlconnection and special characters
body: <p>i can send with my app a http post.
  Problem is, that the special characters like ä, ö , ... will not be correct.</p>
  
  <p>this is my code:</p>
  
  <pre><code>@Override
          protected String doInBackground(String... params) {
              try {
  
                  URL url = new URL("https://xxx");
                  HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                  String urlParameters =  "&amp;name" + name;
  
  
                  connection.setRequestMethod("POST");
                  connection.setRequestProperty("Accept-Charset", "UTF-8");
                  connection.setDoOutput(true);
                  DataOutputStream dStream = new DataOutputStream(connection.getOutputStream());
                  dStream.writeBytes(urlParameters);
                  dStream.flush();
                  dStream.close();
  
  
              } catch (MalformedURLException e) {
                  Log.e("--&gt;", Log.getStackTraceString(e));
              } catch (IOException e) {
                  Log.e("--&gt;", Log.getStackTraceString(e));
              }
              return null;
          }
  </code></pre>
  
  <p>This http post will send to a php file, which saves the value name into a database.</p>
  
  <p>Example:
  The App send the value "Getränke"
  Result in the database: "Getr"</p>
  
  <p>where is my mistake?</p>