HBufC8* to CEikGlobalTextEditor

Login to reply to this topic.
Wed, 2008-01-30 02:59
Joined: 2003-09-15
Forum posts: 175

I have a HBufC8* pData and a TPtr8 ptr8Data(pData->Des()) pointing to some data that I need to display.
Both pointers point to unicode/ascii mix data such as the copyright symbol, euro symbol and otherd.

I am trying to display these characters correctly in my CEikGlobalTextEditor but have encountered several problems.
Either characters are missing, or the euro symbol doesn’t show at all, or I get
those block [] characters you see when a character couldn’t be interpreted/translated.

I know it has something to do with 16bit/8bit conversions but trial and error is getting me nowhere.
Is there a known standard way of correctly displaying Unicode charactersin a CEikGlobalTextEditor
(e.g. using SetTextL() from a HBufC8* pointer?

Paris


~~~~


Wed, 2008-01-30 19:54
Joined: 2003-12-05
Forum posts: 672
Re: HBufC8* to CEikGlobalTextEditor

Have you tried copying the HBufC8 data to HBufC using HBufC::Copy(const TDesC8 & aData)? Then put this HBufC to the editor.

Mon, 2008-02-04 20:12
Joined: 2003-09-15
Forum posts: 175
Re: HBufC8* to CEikGlobalTextEditor

Hi Andreas,
yes I tried that, but unicode characters are always lost. I only get ASCII Sad

If I SetTextL() : Euro=€ Copyright=©
The editor only shows Euro= Copyright=


~~~~

Tue, 2008-02-05 07:18
Joined: 2005-11-20
Forum posts: 1241
Re: HBufC8* to CEikGlobalTextEditor

If you really have Unicode in your *8 bit* descriptor (not really sure, if you ask me), it must be in UTF-8 encoding. SetTextL uses UTF-16. So you must convert first with the help of CnvUtfConverter::ConvertToUnicodeFromUtf8.


René Brunner

Tue, 2008-02-05 13:55
Joined: 2003-09-15
Forum posts: 175
Re: HBufC8* to CEikGlobalTextEditor

I can't thank you enough rbrunner!

Your 3 line suggestion completely fixed my problem.
many many thanks!!!!!!!!!


~~~~

  • Login to reply to this topic.