×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    11

    Compiling Chinese Resource File

    Hi all, does anyone know how to compile a resource file in Chinese with a English SDK? Each time I tried to compile, I got error message complaining "RComp failed ..." Must I compile the Chinese resource file in a Chinese SDK? Thank you!

    Daoshan

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Beijing
    Posts
    3,609
    I tried it in my place. I found there was no problem at all to compile a resource file in Chinese under English SDK.

    Attached please find my sample code for your reference.


    Liuxg
    Forum Nokia
    Attached Files Attached Files

  3. #3
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    99

    different formats of text display

    Hi LiuxG,
    I am developing an application in which i write into a file in one .cpp files and read it back and display in an EDWIN placed in side a form.When i see the form in view mode it displays each character in the edwin separated by a box shaped thing but when i view it in edit mode it just shows perfect.I think theres some problem coz of different formats in writing buffer and reading buffer for a file( TBuf for writing and TBuf8 for reading ).
    i tried taking a big buffer and constantly appending to it the contents of the small TBuf8 buffer but it didnt work.Can you plz tell me what should i change in the following code to get it perfectly work ?


    /////////////////////////////////////////////////////////////////////////////////
    Writing in a file in one source file
    /////////////////////////////////////////////////////////////////////////////////


    TBuf<256> GetBuf;
    GetBuf.Copy(*(iAppDialog->TextEngine()->GetTextForTodo()));
    TBuf<256> TempFile;
    TBuf<128> Dir;
    TempFile.Format(_L("\\system\\apps\\form\\temporary.txt"));
    Dir.Format(_L("\\system\\apps\\form\\"));
    RFs fileSession;
    User::LeaveIfError(fileSession.Connect());
    CleanupClosePushL(fileSession);
    fileSession.MkDir(Dir); // Ignore return value
    RFile file;
    if (file.Replace(fileSession, TempFile, EFileWrite) != KErrNone)
    {
    CAknInformationNote* informationNote = new
    (ELeave)CAknInformationNote;
    informationNote->ExecuteLD(_L("Failed To Open File"));
    CleanupStack::PopAndDestroy(); // close fileSession
    return;
    }
    TPtrC8 ptr((TUint8*)GetBuf.Ptr(), GetBuf.Size());
    CleanupClosePushL(file);
    file.Write(ptr);
    file.Close();
    CleanupStack::PopAndDestroy();
    CleanupStack::PopAndDestroy();

    ///////////////////////////////////////////////////////////////////////////////
    Reading from that same file in another source file
    ///////////////////////////////////////////////////////////////////////////////


    TBuf<128> TempFile;
    TBuf<128> Dir;
    TempFile.Format(_L("\\system\\apps\\form\\temporary.txt"));
    Dir.Format(_L("\\system\\apps\\form\\"));
    RFs fileSession;
    User::LeaveIfError(fileSession.Connect());
    CleanupClosePushL(fileSession);
    fileSession.MkDir(Dir); // Ignore return value
    RFile file;
    if (file.Open(fileSession, TempFile, EFileRead) != KErrNone)
    {
    CAknInformationNote* informationNote = new (ELeave)CAknInformationNote;
    informationNote->ExecuteLD(_L("Failed To Read File"));
    CleanupStack::PopAndDestroy(); // close fileSession
    return;
    }
    CleanupClosePushL(file);
    TBuf8<128> MyBuf;
    TBuf<256> OneMore;
    file.Read(0,MyBuf);
    OneMore.Copy(MyBuf);
    SetEdwinTextL(EAknExFormDlgCtrlIdEdwin01,&OneMore);
    file.Close();
    CleanupStack::PopAndDestroy();
    CleanupStack::PopAndDestroy();
    }

    Regards and Thanks
    Sandy..

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    50
    please do not convert text from TBuf to TBuf8 directly.

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    11
    By the way, which characters should be escaped in the resource file in Chinese besides the normal ones?

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Beijing
    Posts
    3,609
    Hi,

    Could you please refer to the following link:

    &raquo; Symbian OS v6.1 Edition for C++ &raquo; API Guide &raquo; Base &raquo; Character Conversion &raquo; How to use CCnvCharacterSetConverter

    in the SDK for help? I think it provides you enough information about how to do it!

    Liuxg
    Forum Nokia

Posting Permissions

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