How to define a string using unicode?

Login to reply to this topic.
Fri, 2005-06-24 14:03
Anonymous
Forum posts: 2043
#define TEST_STRING "string"  is common way

how do i define a string using unicodes , smth like  code of "S" code of "T" e.t.c....?

i need to define a string in lang other than eng.....
 

Fri, 2005-06-24 14:52
Joined: 2004-05-24
Forum posts: 982
Re: How to define a string using unicode?
Quote from: chishti_hameed
#define TEST_STRING "string"  is common way

how do i define a string using unicodes , smth like  code of "S" code of "T" e.t.c....?

i need to define a string in lang other than eng.....
 


Define your string like this in resource file:  "Normal chars "<0x00aa><0x00ab><0x00ac>" normal chars"

where 00aa, 00ab, 00ac are the codes of what chars do you want to use

pirosl

Mon, 2005-06-27 06:38
chishti_hameed (not verified)
Forum posts: 2043
Re: How to define a string using unicode?
Quote from: pirosl
Quote from: chishti_hameed
#define TEST_STRING "string"  is common way

how do i define a string using unicodes , smth like  code of "S" code of "T" e.t.c....?

i need to define a string in lang other than eng.....
 


Define your string like this in resource file:  "Normal chars "<0x00aa><0x00ab><0x00ac>" normal chars"

where 00aa, 00ab, 00ac are the codes of what chars do you want to use

Not sure if i understood all Sad
could u plz write an example string?
 
Mon, 2005-06-27 08:01
Joined: 2004-05-24
Forum posts: 982
Re: How to define a string using unicode?
#define TEST_STRING "Copyrigth"<0x00a2>" 2004"

pirosl

Mon, 2005-06-27 08:18
chishti_hameed (not verified)
Forum posts: 2043
Re: How to define a string using unicode?
Quote from: pirosl
#define TEST_STRING "Copyrigth"<0x00a2>" 2004"

Actually i'm displaying URDU(same like arabic) chars in my application...
Problem is, app doesnt display all chars. Instead of few char it displays
QUADRATIC SYMBOLS.  I'm inserting that text from NOTEPAD in WinXP
and then reloading resource file into VC6.   

Unicode for one of those symbols which are not being  displayes on
device is "FEA9" .

I want to check if device displays CHAR CORRECT using its Unicode directly.



 
Mon, 2005-06-27 08:54
Joined: 2004-05-24
Forum posts: 982
Re: How to define a string using unicode?
So you actually have problems with character displaying, rigth? Not with defining them in resource. Did i understand well?

pirosl

Mon, 2005-06-27 09:07
chishti_hameed (not verified)
Forum posts: 2043
Re: How to define a string using unicode?
Quote from: pirosl
So you actually have problems with character displaying, rigth? Not with defining them in resource. Did i understand well?

Yeah..... Problem is with displaying char. But i dont know how to define a char using unicode too Tongue
 
as i told in my prev msg, that i'm inserting chars in resource file using notepad. So may be problem with
displaying char is somewhere in fonts (Windows,Symbian) ...

I wanted to confirm if symbian wants to display those char or not but putting their UNICODE value direct in code and
displaying them .

Mon, 2005-06-27 09:47
Forum Nokia Champion
Joined: 2003-06-10
Forum posts: 720
Re: How to define a string using unicode?
The font you're trying to use, probably, does not have a glyph/character corresponding to the code point in question (which is why the square/rectangle is displayed in its place).

So, you also need to find a Unicode font (file) that contains the characters you want to display.
Mon, 2005-06-27 09:53
chishti_hameed (not verified)
Forum posts: 2043
Re: How to define a string using unicode?
Quote from: N/A
The font you're trying to use, probably, does not have a glyph/character corresponding to the code point in question (which is why the square/rectangle is displayed in its place).

So, you also need to find a Unicode font (file) that contains the characters you want to display.

I want to check what system has for this : FEA9 Huh??

Mon, 2005-06-27 16:38
Joined: 2005-06-13
Forum posts: 68
Re: How to define a string using unicode?
This is not much help but you can also define unicode characters in a literal using the notation "\x1234.

For example:
      // a line break
  _LIT(brk, "\x2028") ;

Sorry I can't really help you about why you urdu character "\xFEA9" is not displaying Smiley I'm still struggling with unicode and the differents encodings Smiley

Take care,

Nikolas.

If we fall down it's so we can learn to pick ourselves up.

Mon, 2005-06-27 21:28
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: How to define a string using unicode?
Don't know if it's urdu but you can get arabic codes on Unicode.org
I don't have any arabic mobile but I assume that something like:

Code:
_LIT(KLetterKhah,"\x062e");

should work (and display the arabic letter Khah).


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Tue, 2005-06-28 05:58
chishti_hameed (not verified)
Forum posts: 2043
Re: How to define a string using unicode?
i was looking for this style Smiley

RESOURCE TBUF { buf = <1605><1585>; }

Have downloaded .pdf for urdu chars unicodes........

-------------------------------------------------------------------------
_LIT(KLetterKhah,"\x062e");  //How about multiple chars?Huh



Tue, 2005-06-28 09:44
Joined: 2005-06-13
Forum posts: 68
Re: How to define a string using unicode?
Multiple chars?

_LIT(Message,"\x082\x039")  <-- is this what you mean?

If we fall down it's so we can learn to pick ourselves up.

Thu, 2006-03-02 13:17
Joined: 2006-03-02
Forum posts: 5
Using unicodes.
Hi,

   One can store unicode string in resource file. For that :

1. open your resource file in notepad.

2. Copy ur unicode to resource.
   RESOURCE TBUF resource_name
{
   buf = "copy string here";
}

When u copy string to resource, u should get square boxes.

3.Save ur file in UTF8 format.

4.At the top of your resourcefile Add CHARACTER_SET UTF8 statement.

5. Read ur resource content into TBUF16<size> or HBufC* and display them.

Best of Luck,
  • Login to reply to this topic.