×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Post Catch chinese sms using socket

    When I tried to receive SMS using socket, I can't receive matched SMS starting with Chinese character.

    TSmsAddr smsAddr;
    smsAddr.SetSmsAddrFamily(ESmsAddrMatchText);
    smsAddr.SetTextMatch(_L8("海"));

    I also tried using ConvertFromUnicodeToUtf8(). But if I don't use Chinese character to match, it works fine.

    It's urgent,please help.

    Thanks in advance.
    Raulf

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Catch chinese sms using socket

    Chinese characters are most probably encoded in UCS2, which means practically no encoding at all (1 Chinese character is represented by its 16-bit Unicode character code, residing on 2 bytes).
    You can try weird magics like
    Code:
    TBuf<10> buf=_L("海");
    TPtrC8 ptr8(static_cast<TUint8*>(buf.Ptr()),buf.Size());
    smsAddr.SetTextMatch(ptr8);
    and/or experiment with CSmsAlphabetConverter::ConvertFromNativeL

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Re: Catch chinese sms using socket

    Thanks Wizard,

    It doesn't work for the weird magics.

    I'll check CSmsAlphabetConverter::ConvertFromNativeL and get back here to report result.

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Re: Catch chinese sms using socket

    Tried following code, but it still can't catch specefied SMS.

    RFs fs;
    fs.Connect();
    CleanupClosePushL(fs);
    CCnvCharacterSetConverter* cnv = CCnvCharacterSetConverter::NewLC();
    CSmsAlphabetConverter* convert = CSmsAlphabetConverter::NewLC(*cnv,fs,TSmsDataCodingScheme::ESmsAlphabetUCS2,EFalse); //Tried to change ESmsAlphabetUCS2 to other value and EFalse to ETrue

    TSmsAddr smsAddr;
    smsAddr.SetSmsAddrFamily(ESmsAddrMatchText);
    smsAddr.SetTextMatch(convert->ConvertFromNativeL(_L("海")));
    CleanupStack::PopAndDestroy(3);

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Re: Catch chinese sms using socket

    Anybody can help me?

Similar Threads

  1. How to send chinese sms via socket
    By lesscome3 in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2009-03-05, 14:17
  2. Sending Chinese SMS in 3rd SDK?
    By Wah in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-06-04, 18:27
  3. problem in persistant socket connection
    By poms4symbian in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-01-03, 13:23
  4. chinese sms send solution!
    By serverclient2004 in forum General Messaging
    Replies: 0
    Last Post: 2005-06-03, 06:36
  5. how to support chinese using SDK2.1(Nokia SMS Adapter(PC suite3.7)) in VB6
    By fleastore in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-09-10, 06:28

Posting Permissions

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