What is the Default JDBC Character Encoding

Viewed 1083

I'm developing a Coldfusion app and have seen that I can't insert certain characters into the database. I believe that I can change the JDBC connection string to enable unicode encoding.

However, I would like to know what the default encoding that JDBC uses so I can say what character set is currently safe to use. I can't seem to find information on what the default is anywhere. Does anyone know the default?

Edit:

What it is, while the database is all set for unicode (i can directly insert unicode characters with no problem with SQl using my MySQL client), if i try to insert data from Coldfusion it seems it can't handle the unicode chracters, so it seems the default connection string it uses (we're not specifying one yet) is not unicode compatible

2 Answers

MySQL default encoding is latin1

For applications that store data using the default MySQL character set and collation (latin1, latin1_swedish_ci)

My notes for ColdFusion say

<cfprocessingdirective pageEncoding="utf-8">

<cffile
action="read"
file="#settings.csvfile#"
variable="autodata"
charset="utf-8">

Meanwhile, establish CHARACTER SET utf8mb4 on any columns that need it.

(It seems folly to stick with the very limited latin1, when the future is clearly UTF-8.)

Related