×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    20

    problem converting TBuf8 to TBuf16

    hi all,
    im creating a dynamic submenu using following

    void CMapView:ynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
    {
    if(aResourceId == R_SUB_MENU)
    {
    CEikMenuPaneItem::SData itemData;
    for(int i=0; i < isubMenuArray.Count(); i++)
    {
    itemData.iText.Zero();
    TInt error = CnvUtfConverter::ConvertToUnicodeFromUtf8(itemData.iText,isubMenuArray[i].sampleString);
    itemData.iCommandId = ECommand;
    itemData.iFlags = 0;
    itemData.iCascadeId = 0;
    aMenuPane->AddMenuItemL( itemData );
    }
    }
    }

    but when i click on menu i get the data with every letter appended by a box.
    lets say if my sub menu array had sub1 n sub2 then the menu displays s0u0b01 what could be the problem.
    Sagar Kasture

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: problem converting TBuf8 to TBuf16

    Hi,

    I think the command id should be different.

    anf converting from TBuf8 to TBuf16 use Copy method.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: problem converting TBuf8 to TBuf16

    Apparently you read Unicode data (probably from a file) into a 8-bit descriptor, that is why the squares are inserted. Check how "sampleString" is read/created.

Similar Threads

  1. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  2. converting TBuf8 to TDesC
    By nmnir in forum Symbian
    Replies: 1
    Last Post: 2004-11-07, 20:03
  3. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36
  4. How do I cast/convert TBuf16 to TBuf8 ?
    By mmalo in forum Symbian
    Replies: 3
    Last Post: 2002-08-21, 15:29
  5. PJava runtime problem within Nokia 9210, Hrlp~!
    By Nokia_Archive in forum PersonalJava
    Replies: 1
    Last Post: 2002-05-28, 13:15

Posting Permissions

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