-1

I have this kind of symbols in db table (Наиме) , and I don't know who inserted this data to table.Is there any way to convert them to cyrillic ?

9900kf
  • 87
  • 1
  • 11

1 Answers1

1

Yes, you can do the conversion. Since you haven't mentioned any langauge, so the logic is given:

  1. Assuming the string length is even, take two immediate characters.

  2. Combine the underlying byte values of two characters to give a 16 bit value. This gives you the multi-byte value of Cryllic character. You can decode the value to give its representation using a proper decoding format like utf-8.

  3. Repeat points 1 and 2 for next two characters until the end of string.

If you want, you can implement it in any language of your choice.

RAM
  • 2,413
  • 1
  • 21
  • 33
  • Thank you for answer! Can it be done in oracle sql ? – 9900kf Sep 16 '14 at 04:44
  • Yes you can do it in PL/SQL of Oracle. Do you know what it is? – RAM Sep 16 '14 at 04:49
  • Moreover, it can be done in Oracle SQL itself, but it needs figuring out how to do it. Look out for encoding functions to do it in SQL statement itself. – RAM Sep 16 '14 at 04:52
  • Please be kind to tell, how to take or what command to use to take byte value of symbol(or char) ? – 9900kf Sep 16 '14 at 05:12
  • You are implementing in what platform? Oracle SQL? You have either two ways: direct or indirect. Direct way is to do in SQL a statement and indirect way is to use a scripting language like PHP, Python, RoR, or .net through which you can update the converted value in database. Latter is easier than the former. Do you understand it? – RAM Sep 16 '14 at 05:21
  • Ask any doubts you have. What will you do with the converted values? Will you update the database? Or will you keep the database as it is and present the converted values to the users? – RAM Sep 16 '14 at 05:27
  • Please tell how you solved your problem. What technique did you follow? – RAM Sep 16 '14 at 06:51
  • Actually my main problem was not decoding symbols,but it was one way to solve it.So I found different solution,because dealing with decoding will take a lot of time – 9900kf Sep 18 '14 at 04:01
  • 1
    Could you please mention in brief what the solution was. – RAM Sep 18 '14 at 04:05