C Python Other
Switch branches/tags
Latest commit 000915e Dec 11, 2014 @fumiyas fumiyas Merge pull request #3 from snipsnipsnip/fix-typo-in-pynkf_putchar
Fix typo in pynkf_putchar()
Permalink
Failed to load latest commit information.
mailman
nkf-dist Release 0.1.1 (nkf 2.1.3) Nov 22, 2013
.gitignore .gitignore: *.pyc Mar 4, 2013
CHANGES Release 0.2.0 (nkf 2.1.3) Sep 29, 2014
MANIFEST.in Add MANIFEST.in Mar 4, 2013
Makefile Makefile: Add target 'upload' Mar 4, 2013
README.md
nkf.c Fix typo in pynkf_putchar() Dec 11, 2014
nkf_codecs.py
setup.cfg README: Convert to Markdown Sep 29, 2014
setup.py Release 0.2.0 (nkf 2.1.3) Sep 29, 2014

README.md

Python Interface to NKF

How to Install

Install from PyPI:

$ sudo pip install nkf

Install from source tree:

$ make
$ sudo make install

Usage

## flag is same as the flags of nkf itself
import nkf
output = nkf.nkf(flag, input)

## For example, to convert from euc-jp to utf-8
output = nkf.nkf('-Ew', 'some euc-jp string')

## Guess character encoding
input_encoding = nkf.guess('some string')

guess() function guesses an input string encoding and returns one of next strings:

  • BINARY
  • ASCII
  • Shift_JIS
  • CP932
  • EUC-JP
  • EUCJP-MS
  • CP51932
  • ISO-2022-JP
  • CP50221
  • CP50220
  • UTF-8
  • UTF-16
  • UTF-32