locked
Convert Unicode to RTF charset RRS feed

  • Question

  • User-352287631 posted

    How do I convert a Unicode character to an RTF charset character? I want to write a Russian string to a mostly English RTF file from .Net. I have experimented by pasting the string into the RTF file using Word. Word declares charset204, i.e. cyrillic, and converts each cyrillic character to a hex number, e.g the cyrillic character К (unicode 0x041A) is converted to \'ca.

    Wednesday, October 4, 2006 12:06 PM

Answers

  • User1416329745 posted

    The .NET Char is Unicode by default so you may be able to do it, if you cannot do it with the code in the link below then post again so I can show you how to do it with SQL Server collation.  Hope this helps.

    http://www.developerland.com/DotNet/General/99.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 4, 2006 6:19 PM

All replies

  • User1416329745 posted

    The .NET Char is Unicode by default so you may be able to do it, if you cannot do it with the code in the link below then post again so I can show you how to do it with SQL Server collation.  Hope this helps.

    http://www.developerland.com/DotNet/General/99.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 4, 2006 6:19 PM
  • User-352287631 posted

    Thanks for the link. It looks like a lot of useful stuff.

     The System.Text.Encoding class will give me an encoding for an HTML page, but I can't see how to relate that to the \fcharset204 (cyrillic) that is used in the RTF file. Do you know where there is a definition of the charsets, i.e. the actual characters, rather than just the languages, used in RTF? If this can actually be done with SQL Server collation that would be useful.

    Thursday, October 5, 2006 3:08 AM
  • User-352287631 posted

    Hi Gift,

    Thanks for the pointer. I've done a little more digging and testing. It turns out that the RTF fcharset 204 is the same as codepage 1251 so I can use the System.Text.Encoding class to do the conversion after all. 

    Best regards

    Steve Walsh 

     

     

    Thursday, October 5, 2006 4:37 AM
  • User1416329745 posted
    I am glad you worked it out because I have helped someone with Cryillic collation in the past on a SQL Server forum, it needed Column level collation to render it. If you still want it let me know.
    Thursday, October 5, 2006 5:48 AM