{"id":20997541,"url":"https://github.com/narirou/jconv","last_synced_at":"2025-05-05T04:04:08.208Z","repository":{"id":11908512,"uuid":"14473009","full_name":"narirou/jconv","owner":"narirou","description":"Pure-JavaScript converter for Japanese character encodings.","archived":false,"fork":false,"pushed_at":"2015-07-12T04:21:29.000Z","size":1663,"stargazers_count":99,"open_issues_count":2,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-05T04:04:01.308Z","etag":null,"topics":["encoding","euc-jp","iconv","japanese","jis","shift-jis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narirou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-17T19:22:03.000Z","updated_at":"2025-01-29T15:47:35.000Z","dependencies_parsed_at":"2022-08-25T16:50:24.688Z","dependency_job_id":null,"html_url":"https://github.com/narirou/jconv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narirou%2Fjconv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narirou%2Fjconv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narirou%2Fjconv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narirou%2Fjconv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narirou","download_url":"https://codeload.github.com/narirou/jconv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436291,"owners_count":21747470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encoding","euc-jp","iconv","japanese","jis","shift-jis"],"created_at":"2024-11-19T07:40:11.896Z","updated_at":"2025-05-05T04:04:08.186Z","avatar_url":"https://github.com/narirou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jconv\r\n=====\r\n\r\n\u003e Pure JavaScript Iconv for Japanese encodings.\r\n\r\n[![Build Status][travis-image]][travis-url]\r\n[![Npm Modules][npm-image]][npm-url]\r\n[![MIT Licensed][license-image]][license-url]\r\n\r\n[travis-image]: https://img.shields.io/travis/narirou/jconv.svg?style=flat-square\r\n[travis-url]: https://travis-ci.org/narirou/jconv\r\n[npm-image]: http://img.shields.io/npm/v/jconv.svg?style=flat-square\r\n[npm-url]: https://www.npmjs.org/package/jconv\r\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\r\n[license-url]: http://opensource.org/licenses/MIT\r\n\r\n\r\n * This module supports the encodings commonly used in the Japanese Language:  \r\n   *Shift_JIS(CP932), ISO-2022-JP(-1), EUC-JP, UTF8, UNICODE(UCS2)* conversion.\r\n * Pure Javascript, no need to compile.\r\n * Much faster than [node-iconv](https://github.com/bnoordhuis/node-iconv).\r\n\r\n[[Japanese 日本語]](https://github.com/narirou/jconv/blob/master/READMEja.md)\r\n\r\n\r\n\r\nInstallation\r\n------------\r\n\r\n```bash\r\n$ npm install jconv\r\n```\r\n\r\n\r\n\r\nUsage\r\n-----\r\n\r\nFor example simply convert from **EUC-JP** to **Shift_JIS**:\r\n\r\n```javascript\r\nvar jconv = require( 'jconv' );\r\n\r\nvar SJISBuffer = jconv.convert( EUCJPBuffer, 'EUCJP', 'SJIS' );\r\n```\r\n\r\nAlso available **iconv-lite** syntax:\r\n\r\n```javascript\r\nvar str = jconv.decode( buffer, fromEncoding );\r\n\r\nvar buf = jconv.encode( 'string', toEncoding );\r\n```\r\n\r\n\r\n\r\nAPI\r\n---\r\n\r\n * **jconv( input, fromEncoding, toEncoding )**  \r\n * **jconv.convert( input, fromEncoding, toEncoding )**  \r\n    * `input` {Buffer} or {String}  \r\n    * `fromEncoding`, `toEncoding` {String}:  \r\n       *Shift_JIS(SJIS), ISO-2022-JP(JIS), EUCJP, UTF8, UNICODE(UCS2, UTF16LE)* are available.  \r\n    * `return` {Buffer}  \r\n\r\n * **jconv.decode( inputBuffer, fromEncoding )**  \r\n    * `return` {String}  \r\n\r\n * **jconv.encode( inputString, toEncoding )**  \r\n    * `return` {Buffer}  \r\n\r\n * **jconv.encodingExists( encodingName )**  \r\n    * `return` {Boolean}\r\n\r\n\r\n\r\nPerformance\r\n-----------\r\n\r\nComparison with node-iconv@2.0.7 by converting [Japanese text](http://www.aozora.gr.jp/cards/000148/files/773_14560.html)\r\nusing [Benchmark.js](https://github.com/bestiejs/benchmark.js).  \r\nEnvironment is *Windows7, core i5 2405-S, mem8G, Node 0.10.22*.\r\n(Please check on your hardware.)  \r\n`Gray`: iconv, `Blue`: jconv (higher is better)  \r\n\r\n![jconv - encoding speed test chart](https://raw.github.com/narirou/jconv/master/test/chart/speedLog.png)\r\n[[latest log]](https://github.com/narirou/jconv/blob/master/test/chart/speedLog.txt)  \r\n\r\n\r\n\r\nEncodings\r\n---------\r\n\r\n * Supported: Shift_JIS(CP932), ISO-2022-JP(-1), EUC-JP, UTF8, UNICODE(UCS2).  \r\n \r\n * Supported Windows Dependent Characters \u003c-\u003e JIS Conversion.  \r\n[(problem details)](http://support.microsoft.com/default.aspx?scid=kb;ja;JP170559)  \r\n\r\n * \"JIS X 0208\", \"JIS X 0212\" and \"CP932\" have the Unicode Mapping Table Differences,\r\n  so the specific characters ( ～￠￡∥ etc... ) cannot be round-trip converted by default.  \r\n This module corrects this difference as much as possible when converting.  \r\n[(problem details)](http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html)  \r\n\r\n\r\n\r\nDevelopment \r\n-----------\r\n\r\n * Clone Repository  \r\n```\r\ngit clone https://github.com/narirou/jconv.git  \r\ncd jconv  \r\nnpm install\r\n```\r\n\r\n * Generate Tables  \r\n```\r\n# generates the unicode mapping table module in \"tables\" folder.\r\nnode generators/generate-source  \r\nnode generators/generate\r\n```\r\n\r\n * Test\r\n```\r\ngrunt test\r\n```\r\n\r\n * Speed Test  \r\n```\r\n# First, minify the script by closure-compiler.\r\ngrunt minify\r\n```\r\n```\r\nnode test/speed  \r\n# This results are visualized by chart.js.  \r\n# Plese open \"chart/index.html\".\r\n```\r\n\r\n\r\n\r\nBased on\r\n--------\r\n\r\n * [iconv-lite](https://github.com/ashtuchkin/iconv-lite) by ashtuchkin.\r\n * [Encoding.js](https://github.com/polygonplanet/Unzipper.js) by polygonplanet.\r\n * [iconv-js](https://github.com/Hikaru02/iconv-js) by Hikaru02.\r\n * [node-iconv](https://github.com/bnoordhuis/node-iconv) by bnoordhuis.\r\n * [libiconv-1.9.1-ja-patch Description](http://www2d.biglobe.ne.jp/~msyk/software/libiconv-1.9.1-patch.html) by 森山 将之.\r\n\r\nThank you so much!\r\n\r\n\r\n\r\nNote\r\n----\r\n\r\nPull requests are welcome.\r\n\r\n\r\n\r\nTodo\r\n----\r\n\r\n * Streaming API support\r\n * Support more encodings and languages.\r\n * Cleanup the code and more speed.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarirou%2Fjconv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarirou%2Fjconv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarirou%2Fjconv/lists"}