Re: [gtk-list] Re: gtk_label and internationalisation question



"Matthew J. Francis" wrote:
> 
> >  So:
> >  1. can I put some Japanese text in my source code (I'm using XEmacs +
> >  SKK) ? How ?
> 
> If you look at how I was doing it, you can do something like: "\x24\x22"
> (hiragana "A"), where in general \xHH inserts a (hex) character HH in
> a way that won't choke the compiler. You don't need the escapes, just
> the raw JIS codes.

You've got me wrong. I know what you are saying as I do almost the same.
I have an input file that looks like 

"Japanese text"=Romaji text

I have to parsing functions. One that splits lines into KEYS and VALUES
of the keys. Anything till that "=" is a KEY. The I have the VALUE. My
program displays the KEYS and VALUES in some labels. To decide between
the Japanese or Romaji, im am scanning the KEYS and VALUES for the <ESC>
codes. If the <ESC>$B is detected, then I am entering Japanese mode till
I find <ESC>(B. If these are not found, text is declared Romaji and sent
back as it is. Otherwise the <ESC>$B and <ESC>(B are removed and the
text between them is sent back. This way I can write complex stuff in
XEmacs even though I don't know the coding codes for any of the Japanese
sylabases. I just use SKK to introduce my text. You can see this input
file at: 

http://borco-ei.eng.hokudai.ac.jp/~borco/vdk/applications/langdrill/default.drill

My question was actually how can I keep Japanese text mixed with my
sorce code. And actually to use it. For isnatnce, instead of doing like
you do:

gtk_label_set_text (GTK_LABEL(search_entry_mode_label),"\x24\x22")

just say:

gtk_label_set_text (GTK_LABEL(search_entry_mode_label),zzz)

where zzz should be the "a" written in Japanese. But if you do this
(with your XEmacs), your source code will look something like:

gtk_label_set_text
(GTK_LABEL(search_entry_mode_label),"<ESC>$B\x24\x22<ESC>(B")

and g++ doesn't even compile this because of those <ESC> codes. 

Ionutz


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]