简体   繁体   中英

“¿” (inverted question mark) character in oracle

I found " ¿ " character (inverted question mark) in the database tables in place of single quote ( ' ) character.

Can any one let me know how i can avoid this character from the table.

There are many rows which contains the text with this character but not all single quotes are turning to this ¿ symbol.

I am not even able to filter the rows to update this character (¿) with single quote again.

When i user Like "%¿%" it filters me the text containing ordinary question mark (?)

In general there are two possibilities:

  1. Your database tables really have ¿ characters caused by wrong NLS_LANG settings when data was inserted (or the database character set does not support the special character). In such case the LIKE '%¿%' condition should work. However, this also means you have corrupt data in your database and it is almost impossible to correct them because ¿ stands for any wrong character.
  2. Your client (eg SQL*Plus) is not able to display the special character caused by wrong NLS_LANG settings or the font does not support the special character.

Which client do you use (SQL*Plus, TOAD, SQL Developer, etc.)?

What is your NLS_LANG Environment variable, resp. your Registry key HKLM\\SOFTWARE\\ORACLE\\KEY_%ORACLE_HOME_NAME%\\NLS_LANG or HKLM\\SOFTWARE\\Wow6432Node\\ORACLE\\KEY_%ORACLE_HOME_NAME%\\NLS_LANG ?

What do you get when you select DUMP(... , 1016) from your table?

Was it really a simple quote (ASCII 39)? If they actually were some sort of "smart quotes", those do have mappings in windows-1252 but there is no ISO-8859 mapping for them, so if your database charset is ISO-8859-1 and you try to insert some windows-1252 text, Oracle tries to translete from windows-1252 to ISO-8859-1 and uses chr(191) to signal an unmappable character. chr(191) happens to be the opening question mark.

You can check that by executing this (copy the select to preserve the smart quotes):

select dump('‘’“”') from dual

This behaviour is basically "correct", as what you are asking Oracle to do cannot be done, though it is not very intuitive.

See windows-1252 , ISO8859-1 and ISO-8859-15 charsets for comparison. Note that windows uses the range 127-159 that is not used in the ISO charsets

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM