×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    290

    Rbuf8 to HBufC conversion gives characters like "\xFFFD"

    Hi,


    reading data from a socket like this:

    Code:
    RBuf8 Buffer;
    Buffer.CleanupClosePushL();
    Buffer.CreateL( len );
    Buffer.FillZ();
    iSocket.Read( Buffer, status );
    User::WaitForRequest( status );
    then put it to a 16-Bit Descriptor...

    Code:
    HBufC* tmp( NULL );
    ...
    tmp = CnvUtfConverter::ConvertToUnicodeFromUtf8L( Buffer );

    table field definition goes like this...

    Code:
    TDbCol Fld_XXX ( XXX_Col, EDBColText, 255);

    So reading field data:

    Code:
    HBufC* tmpData = HBufC::NewLC( 255 );
    tmpData = View.ColDes(4);
    then formatting data....for listbox
    Code:
    HBufC Buffer = HBufC::NewLC(255);
    _LIT(KStringHeader,"\t%S\t%S");
    ...
    _LIT(KItemEntryX,"FeedBack:");
    Buffer->Des().Format(KStringHeader(), &KItemEntryX, &*tmpData);
    My Feedback goes like this "Die Übertragung zum SAP System war erfolgreich"

    But tmpData looks like "Die \xFFFD\x0062\x0065rtragung zum..."


    Greetz
    Franky

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

    Re: Rbuf8 to HBufC conversion gives characters like "\xFFFD"

    Checking the bytes you get from the socket may also be a good idea.
    Note that &* can be freely replaced with a nothing. tmpData is a pointer to an object, *tmpData is the object it refers to, and &*tmpData is a pointer to that object, thus it is tmpData. Also note that "HBufC Buffer=HBufC::NewLC(255);" is a fictional part of your code, it can not compile, and it has no role in the code fragment you have posted.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    290

    Re: Rbuf8 to HBufC conversion gives characters like "\xFFFD"

    Hi,

    thanks for your reply! I will check the string i receive from socket. Yes you're right "&*" equal to "".
    Buffer is:

    Code:
    HBufC* buffer = HBufC::NewLC( 255 );
    and this will be used for formatting purposes. And this is not RBuf8!!!!

    Greetz
    Franky

Similar Threads

  1. HBufC to TBuf8 conversion
    By vdharankar in forum Symbian
    Replies: 19
    Last Post: 2010-12-22, 14:55
  2. arabic language support
    By javasymbrew in forum Mobile Java General
    Replies: 7
    Last Post: 2009-05-31, 01:43
  3. Conversion: RBuf8 <-> RBuf16
    By elviin in forum Symbian
    Replies: 15
    Last Post: 2008-10-30, 12:57
  4. New in Symbian (sockets and 1024 characters)
    By arachidyl in forum Symbian
    Replies: 3
    Last Post: 2006-04-03, 18:28
  5. SMS FAQ List
    By paulbrow in forum General Messaging
    Replies: 2
    Last Post: 2004-03-04, 06:09

Posting Permissions

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