Question on unicode and MBCS

Discussion in 'C++' started by John Harrison, Mar 4, 2007.

  1. Bit Byte wrote:
    > I am working on a large project and have several modules written
    > compiled using MBCS. I am considering purchasing a third party library
    > which I understand, is compiled to support unicode strings.
    >
    > Is there anyway I can work with both unicode and multi-byte C strings
    > (MBCS) in the same project ?


    Yes you can. What is it that you think will stop you?

    john
     
    John Harrison, Mar 4, 2007
    #1
    1. Advertising

  2. John Harrison

    Bit Byte Guest

    I am working on a large project and have several modules written
    compiled using MBCS. I am considering purchasing a third party library
    which I understand, is compiled to support unicode strings.

    Is there anyway I can work with both unicode and multi-byte C strings
    (MBCS) in the same project ?
     
    Bit Byte, Mar 4, 2007
    #2
    1. Advertising

  3. John Harrison

    Bit Byte Guest

    John Harrison wrote:

    > Bit Byte wrote:
    >
    >> I am working on a large project and have several modules written
    >> compiled using MBCS. I am considering purchasing a third party library
    >> which I understand, is compiled to support unicode strings.
    >>
    >> Is there anyway I can work with both unicode and multi-byte C strings
    >> (MBCS) in the same project ?

    >
    >
    > Yes you can. What is it that you think will stop you?
    >
    > john


    Just wasn't sure - since the two string types are not interchangeable
    (i.e. without using some kind of conversion function from/to Unicode).

    I was considering convert strings into the correct (i.e. expected)
    format, before passing it to a method - but I just wanted to make sure
    that I was not overlooking anything - or that there were no "gotchas I
    was unaware of
     
    Bit Byte, Mar 4, 2007
    #3
  4. Bit Byte wrote:
    >
    >
    > John Harrison wrote:
    >
    >> Bit Byte wrote:
    >>
    >>> I am working on a large project and have several modules written
    >>> compiled using MBCS. I am considering purchasing a third party
    >>> library which I understand, is compiled to support unicode strings.
    >>>
    >>> Is there anyway I can work with both unicode and multi-byte C strings
    >>> (MBCS) in the same project ?

    >>
    >>
    >>
    >> Yes you can. What is it that you think will stop you?
    >>
    >> john

    >
    >
    > Just wasn't sure - since the two string types are not interchangeable
    > (i.e. without using some kind of conversion function from/to Unicode).
    >
    > I was considering convert strings into the correct (i.e. expected)
    > format, before passing it to a method - but I just wanted to make sure
    > that I was not overlooking anything - or that there were no "gotchas I
    > was unaware of


    Yes you'd have to do the conversion yourself. Since you're programming
    in Windows (I think) it has a couple of built in functions to do those
    conversions.

    However you should ask about them on a Windows programming group, since
    we only deal with C++ language issues here.

    john
     
    John Harrison, Mar 4, 2007
    #4
  5. John Harrison

    Old Wolf Guest

    On Mar 5, 7:57 am, Bit Byte <> wrote:
    > I am working on a large project and have several modules written
    > compiled using MBCS. I am considering purchasing a third party
    > library which I understand, is compiled to support unicode strings.
    >
    > Is there anyway I can work with both unicode and multi-byte C
    > strings (MBCS) in the same project ?


    MBCS stands for multi-byte character set. In fact this is a poor
    name, as it really means multi-byte encoding. The Unicode character
    set can be encoded in a "MBCS" format , the most common such way is
    known as UTF-8. There are other ways to encode Unicode characters,
    such as UTF-16, UCS-2, etc.

    If your application already supports UTF-8 then you should not have
    any trouble. You should find out exactly which encoding formats this
    third-party library supports. If it supports UTF-16 and not UTF-8,
    for example, you may need to add a conversion function into your
    application.
     
    Old Wolf, Mar 5, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MBCS to UTF-8

    , Sep 7, 2005, in forum: Java
    Replies:
    1
    Views:
    2,837
    Roedy Green
    Sep 7, 2005
  2. Edward K. Ream
    Replies:
    5
    Views:
    630
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Oct 23, 2003
  3. Paul Watson
    Replies:
    3
    Views:
    360
  4. Tejas
    Replies:
    1
    Views:
    630
    William Ahern
    Nov 14, 2007
  5. Giovanni Bajo
    Replies:
    2
    Views:
    508
    Martin v. Löwis
    Jan 27, 2008
Loading...

Share This Page