I want my Oracle database to properly store ALL possible UTF8 characters. If NLS_CHARSET is set to AL32UTF8 is that all I need to do? Or do I need to also make sure I use NCHAR and NVARCHAR rather than CHAR and VARCHAR to properly store UTf8 characters?
Do I need to use NVARCHAR rather than VARCHAR to properly store UTF8 characters in Oracle
character-setoracle
Related Question
- Character Set Database Migration
- Can oracle use more memory than memory_max_target
- Oracle DB export, possible charset conversion if NLS_LANG not set
- Mysql – How large space will be occupied by thesql for a varchar utf8 column
- CMD prompt can’t display Unicode characters that are stored in oracle database correctly
- Character set query in Oracle12c
- Error during CSSCAN of Oracle11 database
- Is it safe to use an output (to_char) date format string of more than 22 characters (ORACLE 11)
Best Answer
Good question. I'll give a simplified answer.
Oracle supports two character sets simultaneously, by way of different datatypes and parameters. A "normal" database-wide characterset and a "national" characterset.
Now, the "normal" characterset affects the way that
VARCHAR2
,CHAR
andCLOB
data is stored. The "national" characterset affects the way thatNVARCHAR2
,NCHAR
andNCLOB
data is stored.These are dictated at database creation time. For example:
You can see these by checking in your DB. For example:
NLS_CHARACTERSET
is forCHAR
/VARCHAR2
,NLS_NCHAR_CHARACTERSET
is forNCHAR
/NVARCHAR2
.If your normal characterset is UTF%, you're generally safe staying away from the
N%
datatypes unless you have some strange internationalisation requirements. If so, feel free to edit your question!