0

I have a join problem caused by special characters in a joining key. The key is nvarchar string. Both strings look confusingly the same. (1) Łódzkie (2) Łódzkie

The first is "normal". If I double click it the whole word is selected. If I double click the second word just the half of it is selected (Ł or ódzkie), depending which half is clicked.

I have tried to alter column type from nvarchar to varchar. I think the problem is caused by the first letter. I tried the ascii of the first letter of two cases as select ASCII('Ł') and in both cases I get the result 163.

No luck so far.

Przemyslaw Remin
  • 6,276
  • 25
  • 113
  • 191
  • 2
    Sounds like you might have (hidden) system characters within the string. – Allan S. Hansen Jan 21 '16 at 13:00
  • You can write simple t-sql function to convert your string to array of unicode codes using function like `UNICODE`. So you will see difference. – fabulaspb Jan 21 '16 at 13:03
  • 1
    Try casting the column as varbinary and inspect the code points: `SELECT CAST(Col1 AS varbinary(100)), CAST(Col2 AS varbinary(100))`. Also, be sure to prefix Unicode literals with `N` in your analysis: `SELECT ASCII(N'Ł')`. – Dan Guzman Jan 21 '16 at 13:18
  • @AllanS.Hansen Yep, it solved the issue. The culprit was hidden not in the first letter but in the invisible second. It was invisible `CHAR(129)` - it looks kinda cuckoo egg of space without space. I found it with `unicode(substring(word,2,1))` Thank you all very much. – Przemyslaw Remin Jan 21 '16 at 13:41

0 Answers0