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




borco@borco-ei.eng.hokudai.ac.jp:

> 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. 

You can use euc-jp code instead of jis(iso-2022-jp). Euc-jp
code is not contain ESC-sequence. So, you can write code
like this:

- C source -------------
/* main function */
 gtk_set_locale(); /* setenv LANG ja_JP.ujis ?? */
 gtk_init (&argc, &argv);
 gtk_rc_parse("gtkrc"); 
 ...
                       /* real euc-jp text here */
 label = gtk_label_new ("euc-jp'nized japanese text");
 ...
------------------------

-- gtkrc file ----------
...
style "default"
{
  fontset = "-adobe-helvetica-medium-r-normal--12-*-*-*-*-*-*-*,-misc-fixed-medium-r-normal--12-*-*-*-*-*-jisx0208.1983-0"
}
widget_class "*" style "default"
------------------------

To edit euc-jp text, .emacs is following:

-- .emacs file ---------
  (set-language-environment "Japanese")
  (set-default-coding-systems 'euc-jp)
  (set-terminal-coding-system 'euc-jp)
  (set-buffer-file-coding-system 'euc-jp)
------------------------

--
Mitsuru Oka (Kochi-Univ, Japan)



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