×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    12

    CBrCtlInterface UTF8 charset problem

    Hi,

    I have working custom dialog containing CBrCtlInterface, where I'm opening local html files encoded UTF-8.

    File is opened by
    Code:
    iBrCtlInterface->LoadUrlL( file );
    Html file contains
    Code:
    <HTML>
      <HEAD>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <TITLE>Attraction B</TITLE>
      </HEAD>
    
    <BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
    
    <h1>Attraction B</h1>
    <h2>Header 2</h2>
    <h3>Header 3</h3>
    <h4>Header 4</h4>
    
    <ul>
    <li><b>bold</b>
    <li><i>italic</i>
    <li><u>underline</u>
    <li>
    </ul>
    
    <img src="future01.jpg">
    
    <p>
    text
    </p>
    
    </BODY>
    </HTML>
    Running dialog for the 1st time is OK - text is shown correctly, finally dialog (CBrCtlInterface) is deleted without problem.

    But 2nd time I run the dialog - special characters are displayed incorrectly and during CBrCtlInterface deletion I get KERN-EXEC 3

    Same problem is with charset=iso-8859-2, but for example with charset=iso-8859-1 is everything ok (but it is wrong charset for my purposes)

    Does anybody know, what might be problem?
    Or how to delete instance of CBrCtlInterface, so next time file would be displayed correctly?

    thx in advance

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CBrCtlInterface UTF8 charset problem

    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    12

    Re: CBrCtlInterface UTF8 charset problem

    I don't think this is exactly the same problem as in the link you posted. The difference is that I create only 1 instance of CBrCtlInterface at time.

    With affected codepage encodings (utf-8, iso-8859-2 and may be more) is everything OK for the first time. Then instance of CBrCtlInterface is deleted. Running it second time with new instance and same html page cause distorted text (special characters only - diacritics, special alphabets) and finally get KERN-EXEC 3 on deletion.

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Re: CBrCtlInterface UTF8 charset problem

    Hi ratmonkey,

    Can you paste your dialog's code with CBrCtlInterface control?

    When I wanted to implement such a dialog, I got W32 5 panic on emulator and Kern-Exec 3 on device.

    Here is my code:

    //------------------------------------RSS------------------------------//
    RESOURCE DIALOG r_browser_dialog
    {
    flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar |
    EEikDialogFlagCbaButtons | EEikDialogFlagWait | EEikDialogFlagFillAppClientRect;
    buttons = R_AVKON_SOFTKEYS_OK_BACK;
    }
    //------------------------------------RSS------------------------------//

    //-------------------------------------CPP-----------------------------//

    TInt CMyDialog::RunDlgLD()
    {
    CMyDialog* dlg = new (ELeave) CMyDialog;
    return dlg->ExecuteLD(R_BROWSER_DIALOG);
    }

    void CMyDialog::PreLayoutDynInitL()
    {
    CCoeControl* control = CreateLineByTypeL(KNullDesC, KMyCustomCtlId, KMyCustomCtl, NULL);
    }

    void CMyDialog::PostLayoutDynInitL()
    {
    TRect rect = Rect();
    iBrowserControl->SetRect(rect);
    iBrowserControl->SetMopParent(this);
    iBrowserControl->SetContainerWindowL( *this);

    iBrowserControl->SetBrowserSettingL(TBrCtlDefs::ESettingsSmallScreen,1);
    iBrowserControl->SetBrowserSettingL(TBrCtlDefs::ESettingsEmbedded,1);
    iBrowserControl->SetBrowserSettingL(TBrCtlDefs::ESettingsBrowserUtf8Encoding,1);

    _LIT(KUrl, "c:\\data\\test\\test.htm");
    RFs rfs;
    RFile file;
    User::LeaveIfError(rfs.Connect());
    CleanupClosePushL(rfs);
    User::LeaveIfError(file.Open(rfs, KUrl(), EFileShareReadersOnly));
    CleanupClosePushL(file);
    iBrowserControl->LoadFileL(file);
    CleanupStack::PopAndDestroy(2); // file, rfs

    iBrowserControl->ActivateL();
    }

    SEikControlInfo CMyDialog::CreateCustomControlL(TInt aControlType)
    {
    SEikControlInfo controlInfo;
    controlInfo.iControl = NULL ;
    controlInfo.iTrailerTextId = 0 ;
    controlInfo.iFlags = 0 ;

    switch (aControlType)
    {
    case KMyCustomCtl:
    {
    TRect rect(Position(), Size());

    TInt iCommandBase = TBrCtlDefs::ECommandIdBase;
    TUint iBrCtlCapabilities = TBrCtlDefs::ECapabilityDisplayScrollBar | TBrCtlDefs::ECapabilityLoadHttpFw;
    iBrowserControl = CreateBrowserControlL( this,
    rect,
    iBrCtlCapabilities,
    iCommandBase,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL);
    controlInfo.iControl = iBrowserControl;
    break;
    }
    default:
    break;
    }
    return controlInfo;
    }
    //-----------------------------------------------------CPP------------------------------------//

    I got the panic between PreLayoutDynInitL and PostLayoutDynInitL.

    Thanks in advance

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    42

    Re: CBrCtlInterface UTF8 charset problem

    No response? Can anyone else give me a help?

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    6

    Re: CBrCtlInterface UTF8 charset problem

    I finally can confirm ratmonkey's observation. It's has to do something with encodings, I'm absolutely sure.

    In my app I create several browser control instances to load static HTML files, but only one at a time, i.e. I delete the first instance before creating a second instance. That was all working fine on emulator/target, no crashes at all.

    Due to charset-issues in foreign languages I've now changed the encoding of the static HTML to UTF-8, also I've added following header to each file:

    Code:
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    This is working fine the first time, but the second instance of any browser control either crashes at "LoadFileL" or after calling the destructor, panic is KERN-EXEC 3.

    This definitively another issue than http://wiki.forum.nokia.com/index.ph...econd_instance

    Anyone ideas?

    br,
    flokrates

Similar Threads

  1. Problem with S40 5th Edition emulation, NCF 1.2 and BT dongle
    By nevillesatz in forum Bluetooth Technology
    Replies: 1
    Last Post: 2007-07-05, 10:52
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. 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
  4. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12: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
  •  
×