I have a controller in grails with post action. Now that with php and curl trying to send a message to the grails pipeline, I get ?placeholders for type characters åäö, etc. If I create a small html form that saves the same post, the grails controller gets parameters as åäö, not how ?, etc.
What is the difference between below and how can I get curl to act as an example of an html form?
Twisting example:
$x = curl_init("http://localhost/post");
curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($x, CURLOPT_POST, 1);
curl_setopt($x, CURLOPT_POSTFIELDS, "Foo=ö");
curl_setopt( $x, CURLOPT_ENCODING, "UTF-8" );
curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($x);
curl_close($x);
An example html form:
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head><title></title></head>
<body>
<form name="input" action="http://localhost/post" method="post" enctype="application/x-www-form-urlencoded">
<TEXTAREA NAME="Foo" COLS=10 ROWS=4 type=text>ö</TEXTAREA>
<input class="button" type="submit" value="send"/>
</form>
</body>
</html>
source
share