title: Calculate string size in UTF-8 when converted from Latin-9 (ISO/IEC 8859-15)
body: <p>We have a jdbc program which moves data from one database to another. </p>
  
  <ol>
  <li>Source database is using Latin9 character set</li>
  <li>Destination database uses UTF-8 encoding and the size of a column is specified in bytes instead of characters</li>
  <li>We have converted ddl scripts of source database to equivalent script in destination database keeping the size of the column as-is.</li>
  <li>In some cases, if there are some special characters, the size of the data after converting to UTF-8 is exceeding the size of the column in destination database causing the jdbc program to fail.</li>
  </ol>
  
  <p>I understand that UTF-8 is variable-width encoding scheme which can take 1-4 bytes per character, given this the worst case solution would be to allocate 4 times the size of a column in destination database.</p>
  
  <p>Is there a better estimate? </p>