OSDN Git Service

Show endian on --guess.
[nkf/nkf.git] / NKF.python2 / README
1 Python Interface to NKF2 (2009.06.02)
2
3 1. How to Install
4
5     1) Download latest nkf-2.0.9+ from http://sourceforge.jp/projects/nkf/
6
7     2) $ tar zxvf nkf-2.x.x.tar.gz
8
9     3) $ cd nkf-2.x.x
10
11     4) $ tar zxvf NKF_python.tgz
12
13     5) $ cd NKF.python
14
15     6) # python setup.py install
16
17 2. Usage
18
19     ## flag is same as the flags of nkf itself
20     import nkf
21     output = nkf.nkf(flag, input)
22
23     ## For example, to convert from euc-jp to utf-8
24     output = nkf.nkf('-Ew', 'some euc-jp string')
25
26 3.  guess() function,
27     which guesses input_string_code and returns one of next strings:
28         "BINARY"
29         "ASCII"
30         "Shift_JIS"
31         "CP932"
32         "EUC-JP"
33         "EUCJP-MS"
34         "CP51932"
35         "ISO-2022-JP"
36         "CP50221"
37         "CP50220"
38         "UTF-8"
39     
40     ## For example   
41     import nkf
42     input_code = nkf.guess('some string')
43
44 Matsumoto, Tadashi  ma2@city.plala.jp