title: Kohana 3.2. - Posting UTF-8 characters to external site
body: <p>I'm trying to post UTF-8 characters i.e. German accents to an external site. However when it gets there it appears like this:</p>
  
  <pre><code>Ã¶
  </code></pre>
  
  <p>instead of this:</p>
  
  <pre><code>ö
  </code></pre>
  
  <p>If I var_dump() with the appropriate UTF-8 headers I see the accented letter as it should be.</p>
  
  <p>Here's the code I'm using when attempting to POST:</p>
  
  <pre><code>$request = Request::factory($url)
              -&gt;method(Request::POST)
              -&gt;post($params)
              -&gt;headers('Content-Disposition', 'form-data; name="postdata"')
              -&gt;headers('Content-Type', 'text/plain; charset=UTF-8')
              -&gt;headers('Content-Transfer-Encoding', '8bit');
  $response = $request-&gt;execute();
  </code></pre>
  
  <p>Based on the guide here: <a href="http://kohanaframework.org/3.2/guide/kohana/requests#external-requests" rel="nofollow">http://kohanaframework.org/3.2/guide/kohana/requests#external-requests</a></p>
  
  <p>The receiving URL is built on Java Spring. I have tested the posting process with the use of  JMeter. When posting UTF-8 accented characters it had no problem catching them. The headers in the PHP sample above use the same settings as the tests.</p>
  
  <p>It has to be an issue with the PHP as the JMeter tests worked fine.</p>
  
  <p>I am also able to pull accented UTF-8 characters from a database through to the website via the JAVA receiver site, then through PHP/Kohana/HTML and display them without problems.</p>
  
  <p><strong>Further info:</strong></p>
  
  <p>I have found that if I run </p>
  
  <pre><code>utf8_encode('ö');
  // returns Ã¶
  </code></pre>
  
  <p>So I wonder if this is happening in the POST.</p>