Curious case of hyphen and dash

I am trying to retrieve records from an Oracle 9i database whose value is "FOO-BAR" for a specific column.

The values ​​of the "FOO-BAR" condition are present in the table, but when I run the query, the results do not come.

Once upon a breakdown, it turned out that there is a difference in the size of the hypnas.

'FOO – BAR'
'FOO - BAR'

This time I copied (via SQLDeveloper) the DB value and pasted the value into the Eclipse IDE. I have NOT seen any difference in Eclipse. When I run the request from the IDE, to my surprise, it worked, and the values ​​approached.

I deployed the same class file to our servers (UX field) and returned to square No. 1 again - the values ​​will not appear.

I tried changing the encoding of my default IDE file (Cp1252) to UTF-8, and now everything is fine.

Can someone explain what is happening? Will the size of the hyphen change with the encoding? are there three different types of hyphens?

+3
source share
4 answers

There are many different Unicode characters for em-dash, en-dash, hyphen, etc. They are used in different contexts in the text.

You can read the "Dash" wikipedia article for more information. Note that hyphen is not quite the same :)

, - , , . - , .

+5

?

. , , , Unicode . ( , @Jon Skeet, . , U2500 4 " ", " " " ",.)

.

. , . : , . , .

, , , , . /, "" "" .

. .

+3

rawtohex (col)

  • oracle, , , .
0

, , Oracle ASCII(). .

select ascii(substr(t.strng_field, 5, 1)) from string_table t

.

, convert, decompose unistr, .

0

Source: https://habr.com/ru/post/1758877/


All Articles