Convert Unicode Hex Codes to Actual Character

Started by JTaylor, February 29, 2016, 07:22:41 PM

Previous topic - Next topic

JTaylor

Hopefully this isn't one of those DUH!!! questions...

I am trying to clean up some corruption in a library database which contains over 2,000 unique Unicode Hex Codes such as the following.   Is there a simple way to convert these to the actual character?   I started by looking up the character and doing a straight-forward replace, which works fine, but then I discovered how many unique codes there are and that approach quickly grew undesirable.

Thanks.

Jim

0x5D5;
0x5E8;
0x2BB;
0x1E33;
0x1E24;
0x1E6D;
0x101;
0x12B;
0x113;
0xE9;
0x2BC;
0xE8;

td

Take peek at ChrHexToUnicode in your handy, dandy Consolidated WIL Help file. The characters you listed aren't quite proper 4 nibble Unicode that the function expects but assuming UTF-16 you would just need to pad with zeros to get to something you can use.  Of course, you would need to remove the '0x' business and decide whether or not you are dealing with big-endian or little-endian, as well.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Okay.  Had tried that function but it failed saying they weren't Hex codes.   I am sure the 0x and zero padding are the issue though.  Thanks.

Jim