Mailing List Archive

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

[tlug] Re: Japanese Word processor for linux

Sam Joseph wrote:

> I am now porting to linux and I would love to be able to run the exact 
> same program, ideally with Shift_JIS characters - checking the code out 
> of Perforce onto my Linux box seems to leave the Shift_JIS characters 
> unreadable.  I was wondering if there was some kind of (ideally free) 
> japanese word processor for linux that would let me create files in 
> different japanese encoding formats like NJStar or JWPce do for windows.
> It may of course be that I just need to set my Java environment on linux 
> correctly to allow me to compile the files - any suggestions very 
> gratefully received.

Java uses the LANG and LC_* environment variables to determine which
charset the source files are in.  So if you run java with
LC_CTYPE=ja_JP.SJIS it should work (in theory, I didn't try that).
Under linux the default for Japanese is euc-jp.

You can use the 'locale' tool to see what your apps will think about the
current environment.  The LC_CTYPE setting is responsible for the
expected character encoding.  However the locale tool only shows you the
name of the locale, not the character set used.
To find out the character set you can use the following program:

#include <locale.h>
#include <langinfo.h>

int main(int argc, char **argv)
	setlocale(LC_ALL, "");
	return 0;

You may have to add the locale (ja_JP.SJIS) to /etc/locale.gen and run
locale-gen to generate it.$ ./test
ISO-8859-1$ LC_CTYPE=ja_JP ./test
ANSI_X3.4-1968$ su
melchior:/home/ranma# echo ja_JP.SJIS SJIS >> /etc/locale.gen
melchior:/home/ranma# locale-gen
Generating locales...
  de_DE.ISO-8859-1... done done
  de_DE.UTF-8... done
  en_IN.UTF-8... done
  en_US.ISO-8859-1... done
  en_US.UTF-8... done
  ja_JP.EUC-JP... done
  ja_JP.UTF-8... done
  ja_JP.SJIS...character map `SHIFT_JIS' is not ASCII compatible, locale not ISO C compliant
Generation complete.
melchior:/home/ranma# exit$ LC_CTYPE=ja_JP ./test

/* Tobias */     int main(int a,char **b)    /* PGP: */
{char i,j,t,*r=*++b;srand(getpid());for(;*r;){for(;*r&&!isalpha(*r);r++);for(i=
np: Ziwtra: - Final Fantasy Adventure Willed Assault OC ReMix []

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links