title: How to create CSR with utf8 subject in openssl?
body: <p>I am trying to generate Certificate Signing Request with UTF-8 subject. </p>
  
  <pre><code>$ openssl req  -utf8 -nodes -newkey rsa:2048 -keyout my.private_key.pem -out my.csr.pem -text
  Generating a 2048 bit RSA private key
  ......................................................................................................................................................................+++
  ......+++
  writing new private key to 'my.private_key.pem'
  -----
  You are about to be asked to enter information that will be incorporated
  into your certificate request.
  What you are about to enter is what is called a Distinguished Name or a DN.
  There are quite a few fields but you can leave some blank
  For some fields there will be a default value,
  If you enter '.', the field will be left blank.
  -----
  Country Name (2 letter code) [PL]:
  State or Province Name (full name) []:Zażółć gęślą jaźń
  problems making Certificate Request
  12376:error:0D07A07C:asn1 encoding routines:ASN1_mbstring_ncopy:illegal characters:a_mbstr.c:162:
  </code></pre>
  
  <p>Terminal encoding is UTF-8, I get the same problem when I use command line subject
  <code>(...) -subj /C=PL/ST=zażółć\ gęślą\ jaźń/O=my-company/CN=ThisIsMeForSure</code></p>
  
  <p>When I skip the <code>-utf8</code> switch, the CSR is generated with all the non-ascii characters replaced with hex notation (eg <code>ó</code> becomes <code>\xC3\xB3</code>). Such CSR cannot be read properly with php (<code>openss_x509_parse</code>) - the original <code>ó</code> is read as four bytes, representing two weird characters...</p>
  
  <p>What am I doing wrong? </p>