Unicode filename reading in C#

Results 1 to 3 of 3
  1. #1
    New porn: share'N'leach ivanaivana is offline
    MemberRank
    Oct 2010 Join Date
    RussiaLocation
    323Posts

    Unicode filename reading in C#

    Let me explain situation =/
    My comrade developing some editor for pw. It works fine but dont opens .dds with unicode coded names.
    The aim is opening .dds files with Chinese names (Unicode).

    He have library for opening .dds, but it opens only files with ASCII names and we dont have sources of that lib to upgrade it.
    What can you advice for that purposes? Maybe some Unicode -> ASCII name converter or some lib, which opens .dds with chinese names?

    If you help to fix this issue, maybe he will lower price for rz devs
    Last edited by ivanaivana; 30-09-11 at 12:55 PM.


  2. #2
    uint is best int. Swoosh91 is offline
    MemberRank
    Feb 2010 Join Date
    BerlinLocation
    712Posts

    Re: Unicode filename reading in C#

    When I needed unicode support I casted all strings into array of byte. Since unicode character is 2 byte, just write a string handler class which extends C#'s normal one - I dont like C# that much, but this was possible without s problem in delphi.

    I thought that Widestring is avaliable as default data type in C#?

    Cheers

  3. #3
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Unicode filename reading in C#

    Quote Originally Posted by Swoosh91 View Post
    I thought that Widestring is avaliable as default data type in C#?

    Cheers
    It is... Encoding.Unicode is UTF-16LE and there are a bunch of other available encoding to use... Heck even GB2312 is supported Encoding.GetEncoding("GB2312")

    You don't need to do any kind of byte array casting to get different character support. I'm assuming that whatever library they are using for dds files uses Encoding.ASCII for filename handling...

    (and to answer question about Unicode to ASCII (Even though it won't help) Encoding.ASCII.GetString(Encoding.Unicode.GetBytes(stringVar));)



Advertisement