{"id":13525834,"url":"https://github.com/aadsm/jschardet","last_synced_at":"2025-04-10T09:49:39.315Z","repository":{"id":873535,"uuid":"614723","full_name":"aadsm/jschardet","owner":"aadsm","description":"Character encoding auto-detection in JavaScript (port of python's chardet)","archived":false,"fork":false,"pushed_at":"2024-09-30T21:19:08.000Z","size":1654,"stargazers_count":710,"open_issues_count":29,"forks_count":97,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-10-29T23:13:14.389Z","etag":null,"topics":["character-encoding","charset"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aadsm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-04-17T08:23:09.000Z","updated_at":"2024-10-25T08:01:50.000Z","dependencies_parsed_at":"2024-06-03T22:22:41.054Z","dependency_job_id":"b6eaa463-768b-4553-92cd-af2f8fea8e58","html_url":"https://github.com/aadsm/jschardet","commit_stats":{"total_commits":140,"total_committers":27,"mean_commits":5.185185185185185,"dds":0.6071428571428572,"last_synced_commit":"9c59b6e388ddcdf8708a06da2411f88cc5d294c3"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadsm%2Fjschardet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadsm%2Fjschardet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadsm%2Fjschardet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadsm%2Fjschardet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aadsm","download_url":"https://codeload.github.com/aadsm/jschardet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162092,"owners_count":20733351,"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":["character-encoding","charset"],"created_at":"2024-08-01T06:01:22.674Z","updated_at":"2025-04-10T09:49:39.287Z","avatar_url":"https://github.com/aadsm.png","language":"JavaScript","readme":"[![NPM](https://nodei.co/npm/jschardet.png?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/jschardet/)\n\nJsChardet\n=========\n\nPort of python's chardet (https://github.com/chardet/chardet).\n\nLicense\n-------\n\nLGPL\n\nHow To Use It\n-------------\n\n### Node\n```\nnpm install jschardet\n```\n\n    var jschardet = require(\"jschardet\")\n\n    // \"àíàçã\" in UTF-8\n    jschardet.detect(\"\\xc3\\xa0\\xc3\\xad\\xc3\\xa0\\xc3\\xa7\\xc3\\xa3\")\n    // { encoding: \"UTF-8\", confidence: 0.9690625 }\n\n    // \"次常用國字標準字體表\" in Big5\n    jschardet.detect(\"\\xa6\\xb8\\xb1\\x60\\xa5\\xce\\xb0\\xea\\xa6\\x72\\xbc\\xd0\\xb7\\xc7\\xa6\\x72\\xc5\\xe9\\xaa\\xed\")\n    // { encoding: \"Big5\", confidence: 0.99 }\n\n    // Martin Kühl\n    // jschardet.detectAll(\"\\x3c\\x73\\x74\\x72\\x69\\x6e\\x67\\x3e\\x4d\\x61\\x72\\x74\\x69\\x6e\\x20\\x4b\\xfc\\x68\\x6c\\x3c\\x2f\\x73\\x74\\x72\\x69\\x6e\\x67\\x3e\")\n    // [\n    //   {encoding: \"windows-1252\", confidence: 0.95},\n    //   {encoding: \"ISO-8859-2\", confidence: 0.8796300205763055},\n    //   {encoding: \"SHIFT_JIS\", confidence: 0.01}\n    // ]\n\n### Browser\nCopy and include [jschardet.min.js](https://github.com/aadsm/jschardet/tree/master/dist/jschardet.min.js) in your web page.\n\nThis library is also available in [cdnjs](https://cdnjs.com) at [https://cdnjs.cloudflare.com/ajax/libs/jschardet/1.4.1/jschardet.min.js](https://cdnjs.cloudflare.com/ajax/libs/jschardet/1.4.1/jschardet.min.js)\n\nOptions\n-------\n\n```javascript\n// See all information related to the confidence levels of each encoding.\n// This is useful to see why you're not getting the expected encoding.\njschardet.enableDebug();\n\n// Default minimum accepted confidence level is 0.20 but sometimes this is not\n// enough, specially when dealing with files mostly with numbers.\n// To change this to 0 to always get something or any other value that can\n// work for you.\njschardet.detect(str, { minimumThreshold: 0 });\n\n// Lock down which encodings to detect, can be useful in situations jschardet\n// is giving a higher probability to encodings that you never use.\njschardet.detect(str, { detectEncodings: [\"UTF-8\", \"windows-1252\"] });\n```\n\nSupported Charsets\n------------------\n\n* Big5, GB2312/GB18030, EUC-TW, HZ-GB-2312, and ISO-2022-CN (Traditional and Simplified Chinese)\n* EUC-JP, SHIFT_JIS, and ISO-2022-JP (Japanese)\n* EUC-KR and ISO-2022-KR (Korean)\n* KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, and windows-1251 (Russian)\n* ISO-8859-2 and windows-1250 (Hungarian)\n* ISO-8859-5 and windows-1251 (Bulgarian)\n* windows-1252\n* ISO-8859-7 and windows-1253 (Greek)\n* ISO-8859-8 and windows-1255 (Visual and Logical Hebrew)\n* TIS-620 (Thai)\n* UTF-32 BE, LE, 3412-ordered, or 2143-ordered (with a BOM)\n* UTF-16 BE or LE (with a BOM)\n* UTF-8 (with or without a BOM)\n* ASCII\n\nTechnical Information\n---------------------\n\nI haven't been able to create tests to correctly detect:\n\n* ISO-2022-CN\n* windows-1250 in Hungarian\n* windows-1251 in Bulgarian\n* windows-1253 in Greek\n* EUC-CN\n\nDevelopment\n-----------\nUse `npm run dist` to update the distribution files. They're available at https://github.com/aadsm/jschardet/tree/master/dist.\n\nAuthors\n-------\n\nPorted from python to JavaScript by António Afonso (https://github.com/aadsm/jschardet)\n\nTransformed into an npm package by Markus Ast (https://github.com/brainafk)\n","funding_links":[],"categories":["Repository","JavaScript"],"sub_categories":["Text/String"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadsm%2Fjschardet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faadsm%2Fjschardet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadsm%2Fjschardet/lists"}