title: Postgres UTF8 ordering
body: <p>I have this query in Postgres where I'm ordering a small amount of rows according to a varchar field. There seems to be an error in ordering UTF8 strings in Postgres:</p>
  
  <p>For example:</p>
  
  <p>'W' in UTF-8 is 87, while 'g' is 103, but running <code>SELECT 'W' &lt; 'g';</code> will return <code>false</code> while running <code>SELECT convert_to('W', 'SQL_ASCII') &lt; convert_to('g', 'SQL_ASCII')';</code> will return <code>true</code>.</p>
  
  <p>The collation is <code>en_US.UTF-8</code>.</p>
  
  <p>Is there a good explanation for this behavior? And how to avoid it?</p>