views:

316

answers:

1

I try to send an email using utl_smtp with Oracle including norwegian characters (å æ ø). The characters are stored and displayed correctly in the database otherwise, but shows up as question marks in the email.

My database character set is WE8MSWIN1252

I have tried different Content-Type mime headers in the email including 'text/plain; charset="win-1252"', this does not seem to help.

+3  A: 

Hi fdl,

By default smtp is 7bit ascii (kinda old tech :). You must be using UTL_SMTP.write_data and from the documentation:

Text (VARCHAR2) data sent using WRITE_DATA is converted to US7ASCII before it is sent. If the text contains multibyte characters, each multibyte character in the text that cannot be converted to US7ASCII is replaced by a '?' character. If 8BITMIME extension is negotiated with the SMTP server using the EHLO subprogram, multibyte VARCHAR2 data can be sent by first converting the text to RAW using the UTL_RAW package, and then sending the RAW data using WRITE_RAW_DATA.

There is a sample demo package on OTN that shows how to send multibyte emails.

Vincent Malgrat
Thank you very much Vincent!
fdl