Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User aamitgupta's Avatar
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503
    i ALL,

    I made an application that send sms after scheduling, if message is in English then no problem, but if i write message in any language like Chines, Hindi, the character chages in ???? like question marks, please any body tell me how can i do it universal.


    i tried the CsmsPDU->SetAlphabet(), but now message does not open. and when i write same string in file by RFileLogger, there is no changes in language but in sms the character changes in to ???? Question marks.

    This is my following post that i posted in networking inmessaging but not get any solution

    http://discussion.forum.nokia.com/fo...d.php?t=156530
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  2. #2
    Nokia Developer Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,308
    Try to set unicode character set:

    Code:
    CSmsSettings* sendOptions = CSmsSettings::NewL();
    ...
    // here we modified the character set
    sendOptions->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2) ;

  3. #3
    Nokia Developer Champion Nitesh Bhardwaj's Avatar
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777
    try with this,
    TSmsUserDataSettings settings;
    msg.UserDataSettings( settings );
    smsSettings.SetAlphabet (TSmsDataCodingScheme::ESmsAlphabetUCS2);
    for more info about sms go on this,
    http://www.forum.nokia.com/Resources...ging/FAQ.xhtml

  4. #4
    Registered User aamitgupta's Avatar
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503
    Quote Originally Posted by Nitesh Bhardwaj View Post
    try with this,
    TSmsUserDataSettings settings;
    msg.UserDataSettings( settings );
    smsSettings.SetAlphabet (TSmsDataCodingScheme::ESmsAlphabetUCS2);
    for more info about sms go on this,
    http://www.forum.nokia.com/Resources...ging/FAQ.xhtml
    Nitesh, i m using this approach but not compile the code, wher i put it in my code.
    Code:
    void CSendSms::SendSocketSms(TPtrC msgbody,TPtrC phnumber)
    {
     RSocketServ sockServ;
     RSocket socket;
     User::LeaveIfError(sockServ.Connect());
     CleanupClosePushL(sockServ);
     User::LeaveIfError(socket.Open(sockServ, KSMSAddrFamily,      KSockDatagram,   KSMSDatagramProtocol));
     CleanupClosePushL(socket);
     TSmsAddr smsaddr;
     smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
     User::LeaveIfError(socket.Bind(smsaddr));
     RFs fileSession;
     User::LeaveIfError(fileSession.Connect());
     CleanupClosePushL(fileSession);
     CSmsBufferBase *buffer = CSmsBuffer::NewL();
     CleanupStack::PushL(buffer);
     buffer->InsertL(0, msgbody);
     CSmsMessage *cSmsMessage = CSmsMessage::NewL(fileSession,      CSmsPDU::ESmsSubmit, buffer);
     CleanupStack::Pop(buffer);//cSmsMessage takes ownership
     CleanupStack::PushL(cSmsMessage);
     cSmsMessage->SetToFromAddressL(phnumber);
     CheckSmsFlag(17);
     cSmsMessage->SmsPDU().SetServiceCenterAddressL(myservicecenter);
     RSmsSocketWriteStream writestream(socket);
     writestream << *cSmsMessage; // remember, this can Leave!
     writestream.CommitL();
     TRequestStatus status;
     TPckgBuf<TUint> sendBuffer;
     socket.Ioctl(KIoctlSendSmsMessage, status, &sendBuffer, KSolSmsProv);
     User::WaitForRequest(status);
     socket.Close();
     sockServ.Close();          /////////close to make again the connection
     CleanupStack::PopAndDestroy(cSmsMessage);
     CleanupStack::PopAndDestroy(3);//fileSession
    }
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  5. #5
    Nokia Developer Champion Nitesh Bhardwaj's Avatar
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777
    ok do like this,


    RSocketServ sockServ;
    RSocket socket;
    User::LeaveIfError(sockServ.Connect());
    CleanupClosePushL(sockServ);
    User::LeaveIfError(socket.Open(sockServ, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol));
    CleanupClosePushL(socket);
    TSmsAddr smsaddr;
    smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
    User::LeaveIfError(socket.Bind(smsaddr));
    RFs fileSession;
    User::LeaveIfError(fileSession.Connect());
    CleanupClosePushL(fileSession);
    CSmsBufferBase *buffer = CSmsBuffer::NewL();
    CleanupStack::PushL(buffer);
    buffer->InsertL(0, msgbody);


    CSmsMessage *cSmsMessage = CSmsMessage::NewL(fileSession, CSmsPDU::ESmsSubmit, buffer);
    CleanupStack::Pop(buffer);//cSmsMessage takes ownership
    CleanupStack::PushL(cSmsMessage);

    CSmsBufferBase& buf = cSmsMessage->Buffer();
    CSmsPDU &pdu = cSmsMessage->SmsPDU();
    CSmsUserData& userData = pdu.UserData();
    TSmsUserDataSettings settings;
    cSmsMessage->UserDataSettings( settings );
    settings.SetAlphabet( TSmsDataCodingScheme::ESmsAlphabetUCS2);
    cSmsMessage->SetUserDataSettingsL( settings );

    cSmsMessage->SetToFromAddressL(phnumber);
    CheckSmsFlag(17);
    cSmsMessage->SmsPDU().SetServiceCenterAddressL(myservicecenter);
    RSmsSocketWriteStream writestream(socket);
    writestream << *cSmsMessage; // remember, this can Leave!
    writestream.CommitL();
    TRequestStatus status;
    TPckgBuf<TUint> sendBuffer;
    socket.Ioctl(KIoctlSendSmsMessage, status, &sendBuffer, KSolSmsProv);
    User::WaitForRequest(status);
    socket.Close();
    sockServ.Close(); /////////close to make again the connection
    CleanupStack::PopAndDestroy(cSmsMessage);
    CleanupStack::PopAndDestroy(3);//fileSession

  6. #6
    Registered User aamitgupta's Avatar
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503
    Quote Originally Posted by Nitesh Bhardwaj View Post
    ok do like this,
    Thanks Nitesh, now this is working.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

Similar Threads

  1. Replies: 2
    Last Post: 2009-10-20, 07:51
  2. S40 can't support SMS ?
    By bokiteam2001 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2007-06-14, 11:42
  3. Nokia6230 does not support SMS signing??
    By billlion in forum General Messaging
    Replies: 0
    Last Post: 2006-03-17, 09:48
  4. About S60 Chinese MIDP SDK Chinese language support
    By zhaolikang in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-09, 02:38
  5. SMS Support J2ME
    By TheCyclops in forum Mobile Java General
    Replies: 1
    Last Post: 2003-08-19, 07:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved