title: How to discard Oracle UTF-8 characters when writing to a file with utl_file.put_line
body: <p>I am using the following code to write to a file in Oracle PL/SQL.</p>
  
  <pre><code>l_file := utl_file.fopen('HR_OUT', 'TRUMEDAID.txt', 'w');
  utl_file.put_line
  (
     l_file,
     utl_raw.cast_to_varchar2
     (
        utl_raw.convert
        (
           utl_raw.cast_to_raw(rec_text),
           'AMERICAN_AMERICA.WE8ISO8859P1',   -- To character set.
           'AMERICAN_AMERICA.AL32UTF8'        -- From Character set.
        )
     )
  );
  </code></pre>
  
  <p>However this does not discard the UTF-8 characters but instead translates <code>Pamêla&amp;~</code> into <code>Pam�&amp;~</code>. Is there another way that would at least give <code>Pam�la&amp;~</code>? Why isn't the ascii character ê used?</p>