Results 1 to 5 of 5

Thread: Is this a bug? (Wide char)

  1. #1
    while(1){} is offline Registered User
    Join Date
    Dec 2005
    Posts
    8

    Is this a bug? (Wide char)

    The following two code segments can not run correctly, whether it is a bug of ICE?
    How to...?

    My EMail: wynner@126.com
    ====================================

    ......
    ......

    #include <conio.h>
    #include <iostream>
    #include <string>
    #include <comdef.h>

    using namespace std;

    ......
    ......

    int _tmain(int argc, _TCHAR* argv[])
    {
    wstring s = L"W0:<####>"; //"####" is chinese word (wide char), can not be display
    wcout << s << endl;
    wcout << L"W1:<####>" << endl; //"####" is chinese word(wide char) can not be display

    _bstr_t bstr = "W2:<####>";
    cout << (LPCTSTR)bstr << endl;
    getch();
    return 0;
    }
    ......
    ......

    ====================================



    ......
    ......

    #include <conio.h>
    #include <iostream>
    #include <string>
    #include <comdef.h>

    using namespace std;

    int main(int argc, char* argv[])
    {
    wstring s = L"W0:<简体汉字>";
    wcout << s << endl;

    wcout << L"W1:<简体汉字>" << endl;

    _bstr_t bstr = "W2:<简体汉字>";

    cout << (LPCTSTR)bstr << endl;
    getch();

    return 0;
    }

    ......
    ......
    Last edited by while(1){}; 01-05-2006 at 03:43 AM.

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Welcome to the forums! Please see this thread for information on our support policy. Could you also provide more information about your problem? I don't see how your question is related to Ice for instance.

    Thanks,

    Benoit.

  3. #3
    OrNot is offline Registered User
    Name: Bin.Li
    Organization: GE Healthcare
    Project: Enterprise solution
    Join Date
    Jun 2005
    Location
    Shanghai
    Posts
    181
    hi,
    So far as your codes, no Ice is involved at all. It is none of ice's business .
    To display the 汉字, fellowing codes may be helpful:

    ........
    std::wcout.imbue(std::locale("chs"));
    std::wcout<< L"宽字符 " <<std::endl;
    ........

    When Ice is introduced , consider using the IceUtil::stringToWstring()
    function to translate the UTF8 to UTF16 .

    Finally, remember to edit your signature to get the helps from ICE guys. They are the actual specialists .

    Cheers
    OrNot
    ------------------------------------------
    ornot2008@yahoo.com
    --------------------------------------------

  4. #4
    while(1){} is offline Registered User
    Join Date
    Dec 2005
    Posts
    8
    These code exist in a project base on ICE, and the two code segments can not run correctly after ICE was installed.
    now, I am not sure whether ICE cause this problem or not, so, I need you to help me.

    Thanks
    Last edited by while(1){}; 01-05-2006 at 04:24 AM.

  5. #5
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    As Benoit said, if you want us to help you please fill out your signature information as described in the post that he quoted.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. a missing char in v.3.4 manual
    By n2503v in forum Bug Reports
    Replies: 0
    Last Post: 03-13-2010, 01:31 AM
  2. problem with char ':' in identity.name
    By xdm in forum Help Center
    Replies: 4
    Last Post: 06-20-2006, 04:12 AM
  3. I need char pointers (char *)
    By catalin in forum Help Center
    Replies: 5
    Last Post: 08-16-2004, 04:33 PM
  4. Replies: 4
    Last Post: 05-28-2004, 05:52 PM
  5. Using Char* with SLICE
    By amrufon in forum Help Center
    Replies: 2
    Last Post: 08-01-2003, 09:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •