Skip to content

Instantly share code, notes, and snippets.

@lgrz
Created February 17, 2013 11:50
Show Gist options
  • Save lgrz/4971171 to your computer and use it in GitHub Desktop.
Save lgrz/4971171 to your computer and use it in GitHub Desktop.
Sample multipart/form-data POST with non-ASCII chars.
<?php
// utf-8 is the default setting, just to be sure for this example.
ini_set('default_charset', 'UTF-8');
if (count($_POST)) {
var_dump($_POST);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>charset test</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" accept-charset="utf-8">
<input type="text" name="name" value="éllo" />
<input type="text" name="foo[]" value="así" />
<input type="text" name="foo[]" value="comó" />
<input type="text" name="foo[bar]" value="広告掲載" />
<p><input type="submit" value="Continue &rarr;" /></p>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment