# Character Encoding Utils
[![Python](https://img.shields.io/badge/python-3.10-brightgreen)](https://www.python.org)
[![PyPI](https://img.shields.io/pypi/v/character-encoding-utils)](https://pypi.org/project/character-encoding-utils/)
Some [character encoding](https://en.wikipedia.org/wiki/Character_encoding) utils.
Now support:
- [GB2312](https://en.wikipedia.org/wiki/GB_2312)
- [Big5](https://en.wikipedia.org/wiki/Big5)
- [Shift-JIS](https://en.wikipedia.org/wiki/Shift_JIS)
- [KS-X-1001](https://en.wikipedia.org/wiki/KS_X_1001)
## Installation
```shell
pip install character-encoding-utils
```
## Usage
### GB2312
```python
from character_encoding_utils import gb2312
bs = gb2312.encode('abc中国')
assert gb2312.decode(bs) == 'abc中国'
```
### Big5
```python
from character_encoding_utils import big5
bs = big5.encode('abc中國')
assert big5.decode(bs) == 'abc中國'
```
### Shift-JIS
```python
from character_encoding_utils import shiftjis
bs = shiftjis.encode('abc日本')
assert shiftjis.decode(bs) == 'abc日本'
```
### KS-X-1001
```python
from character_encoding_utils import ksx1001
bs = ksx1001.encode('abc가쳰')
assert ksx1001.decode(bs) == 'abc가쳰'
```
## License
Under the [MIT license](LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "character-encoding-utils",
"maintainer": "TakWolf",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "big5, encoding, gb2312, ksx1001, shift-jis",
"author": "TakWolf",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/36/67/00c774ffe5d25dfba2140f1b601260f86af0879108e1129197a4ccdd1481/character_encoding_utils-0.0.8.tar.gz",
"platform": null,
"description": "# Character Encoding Utils\n\n[![Python](https://img.shields.io/badge/python-3.10-brightgreen)](https://www.python.org)\n[![PyPI](https://img.shields.io/pypi/v/character-encoding-utils)](https://pypi.org/project/character-encoding-utils/)\n\nSome [character encoding](https://en.wikipedia.org/wiki/Character_encoding) utils.\n\nNow support:\n\n- [GB2312](https://en.wikipedia.org/wiki/GB_2312)\n- [Big5](https://en.wikipedia.org/wiki/Big5)\n- [Shift-JIS](https://en.wikipedia.org/wiki/Shift_JIS)\n- [KS-X-1001](https://en.wikipedia.org/wiki/KS_X_1001)\n\n## Installation\n\n```shell\npip install character-encoding-utils\n```\n\n## Usage\n\n### GB2312\n\n```python\nfrom character_encoding_utils import gb2312\n\nbs = gb2312.encode('abc\u4e2d\u56fd')\nassert gb2312.decode(bs) == 'abc\u4e2d\u56fd'\n```\n\n### Big5\n\n```python\nfrom character_encoding_utils import big5\n\nbs = big5.encode('abc\u4e2d\u570b')\nassert big5.decode(bs) == 'abc\u4e2d\u570b'\n```\n\n### Shift-JIS\n\n```python\nfrom character_encoding_utils import shiftjis\n\nbs = shiftjis.encode('abc\u65e5\u672c')\nassert shiftjis.decode(bs) == 'abc\u65e5\u672c'\n```\n\n### KS-X-1001\n\n```python\nfrom character_encoding_utils import ksx1001\n\nbs = ksx1001.encode('abc\uac00\uccf0')\nassert ksx1001.decode(bs) == 'abc\uac00\uccf0'\n```\n\n## License\n\nUnder the [MIT license](LICENSE).\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Some character encoding utils.",
"version": "0.0.8",
"project_urls": {
"homepage": "https://github.com/TakWolf/character-encoding-utils",
"issues": "https://github.com/TakWolf/character-encoding-utils/issues",
"source": "https://github.com/TakWolf/character-encoding-utils"
},
"split_keywords": [
"big5",
" encoding",
" gb2312",
" ksx1001",
" shift-jis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c0071766d9279525e1db9a30e7f86189ed091a813804e008f51bb92079cfd36b",
"md5": "596989180476d9e4c78d9f75ad53f801",
"sha256": "528a29ce45bc394d052e5678401c67ae4441273686a51eae536be7a7989dee9c"
},
"downloads": -1,
"filename": "character_encoding_utils-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "596989180476d9e4c78d9f75ad53f801",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 8789,
"upload_time": "2024-05-15T17:40:52",
"upload_time_iso_8601": "2024-05-15T17:40:52.081062Z",
"url": "https://files.pythonhosted.org/packages/c0/07/1766d9279525e1db9a30e7f86189ed091a813804e008f51bb92079cfd36b/character_encoding_utils-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "366700c774ffe5d25dfba2140f1b601260f86af0879108e1129197a4ccdd1481",
"md5": "fedd544c4f935d2b70a64119f9898a12",
"sha256": "5175f82ffc7b7cfdfb64414308f734291372c78ef1bf0634273fa57f1cd4ba58"
},
"downloads": -1,
"filename": "character_encoding_utils-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "fedd544c4f935d2b70a64119f9898a12",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 9217,
"upload_time": "2024-05-15T17:40:53",
"upload_time_iso_8601": "2024-05-15T17:40:53.146181Z",
"url": "https://files.pythonhosted.org/packages/36/67/00c774ffe5d25dfba2140f1b601260f86af0879108e1129197a4ccdd1481/character_encoding_utils-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-15 17:40:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TakWolf",
"github_project": "character-encoding-utils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pytest",
"specs": [
[
"==",
"8.2.0"
]
]
}
],
"lcname": "character-encoding-utils"
}