Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User devian1001's Avatar
    Join Date
    Apr 2007
    Posts
    46
    Hi everyone,

    i have a problem when i try to use CnvUtfConverter::ConvertFromUnicodeToUtf8.

    I have a function like that

    void CMByDB::addNewItem(TDesC& fileName, TInt fileType)
    {
    //since my fileName column type is EDbColText8 so i do a conversion like that
    //convert from 16bit to 8bit
    TBuf8<768> aFileName8;
    CnvUtfConverter::ConvertFromUnicodeToUtf8(aFileName8,fileName);
    .....
    }

    but the output of before and after conversion is not same.

    Do you know what is the problem ? Please give me suggestion how to solve it.

    Thank you very much.

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,746
    Quote Originally Posted by devian1001
    but the output of before and after conversion is not same.
    What kind of difference have you experienced?

  3. #3
    Registered User devian1001's Avatar
    Join Date
    Apr 2007
    Posts
    46
    the character format is all changed. this is what i have experienced. please give me ideas or other solution to convert between 16 bit descriptor and 8 bit descriptor.

    Thank you so much.

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,712
    Are you sure you want to use UTF8, with it characters are not presented as bytes really. Maybe you should try something else, like IS0 8859-1 for example..

    yucca

  5. #5
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,746
    If you use standard ASCII characters (so the upper 8 bits of your Unicode characters are 0), TDes8::Copy(const TDesC16&) and TDes16::Copy(const TDesC8&) may also help.

  6. #6
    Registered User devian1001's Avatar
    Join Date
    Apr 2007
    Posts
    46
    sorry yucca, my mistake, i am using the ASCII. I have try what wizard suggested, but the characters in the target also changed. Any other ideas ?
    Anyway, thank so much for your help.

  7. #7
    Super Contributor Paul.Todd's Avatar
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644
    Why don't you post the text that is causing the problem?

  8. #8
    Registered User devian1001's Avatar
    Join Date
    Apr 2007
    Posts
    46
    Thanks for your reply.

    My source descriptor contains a file path, forexample c:\data\immages\pictures\file1.txt, when i try to use TDes8::Copy(const TDesC16&) like Wizard suggestted. the destination descriptor is not same as source one. The destination looks like this C\aaIae\itrstx0.x╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠

    Please give me suggestion how to solve it. thank you

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  5. wireless problem
    By sash_mca in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2003-06-06, 11:34

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