{"id":38604515,"url":"https://github.com/albfernandez/juniversalchardet","last_synced_at":"2026-01-17T08:36:39.530Z","repository":{"id":44329137,"uuid":"52904516","full_name":"albfernandez/juniversalchardet","owner":"albfernandez","description":"Originally exported from code.google.com/p/juniversalchardet","archived":false,"fork":false,"pushed_at":"2025-11-22T20:33:57.000Z","size":792,"stargazers_count":366,"open_issues_count":10,"forks_count":72,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-11-22T22:17:51.029Z","etag":null,"topics":["java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albfernandez.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-03-01T19:39:43.000Z","updated_at":"2025-11-22T20:34:02.000Z","dependencies_parsed_at":"2024-06-03T01:14:27.886Z","dependency_job_id":"c0925394-9aac-424b-b2e7-34a2b7120b2b","html_url":"https://github.com/albfernandez/juniversalchardet","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/albfernandez/juniversalchardet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjuniversalchardet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjuniversalchardet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjuniversalchardet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjuniversalchardet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albfernandez","download_url":"https://codeload.github.com/albfernandez/juniversalchardet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjuniversalchardet/sbom","scorecard":{"id":178149,"data":{"date":"2025-08-11","repo":{"name":"github.com/albfernandez/juniversalchardet","commit":"b43c5b5e9b4519cfb7ae7702a305572212f7a11b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Maintained","score":2,"reason":"2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/juniversalchardet/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/juniversalchardet/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/juniversalchardet/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/juniversalchardet/maven.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/juniversalchardet/maven.yml/main?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.5.0 not signed: https://api.github.com/repos/albfernandez/juniversalchardet/releases/157652213","Warn: release artifact v2.0.4 not signed: https://api.github.com/repos/albfernandez/juniversalchardet/releases/157628567","Warn: release artifact v2.4.0 not signed: https://api.github.com/repos/albfernandez/juniversalchardet/releases/33951358","Warn: release artifact v2.3.2 not signed: https://api.github.com/repos/albfernandez/juniversalchardet/releases/24972516","Warn: release artifact v2.3.1 not signed: https://api.github.com/repos/albfernandez/juniversalchardet/releases/24100623","Warn: release artifact v2.5.0 does not have provenance: https://api.github.com/repos/albfernandez/juniversalchardet/releases/157652213","Warn: release artifact v2.0.4 does not have provenance: https://api.github.com/repos/albfernandez/juniversalchardet/releases/157628567","Warn: release artifact v2.4.0 does not have provenance: https://api.github.com/repos/albfernandez/juniversalchardet/releases/33951358","Warn: release artifact v2.3.2 does not have provenance: https://api.github.com/repos/albfernandez/juniversalchardet/releases/24972516","Warn: release artifact v2.3.1 does not have provenance: https://api.github.com/repos/albfernandez/juniversalchardet/releases/24100623"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T18:13:50.634Z","repository_id":44329137,"created_at":"2025-08-16T18:13:50.634Z","updated_at":"2025-08-16T18:13:50.634Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["java"],"created_at":"2026-01-17T08:36:38.889Z","updated_at":"2026-01-17T08:36:39.519Z","avatar_url":"https://github.com/albfernandez.png","language":"Java","readme":"# juniversalchardet\r\n\r\n\r\n## What is it?\r\n\r\njuniversalchardet is a Java port of \"universalchardet\",\r\nthat is the encoding detector library of Mozilla.\r\n\r\n\r\n## Encodings that can be detected\r\n\r\n- Chinese\r\n  - ISO-2022-CN\r\n  - BIG-5\r\n  - EUC-TW\r\n  - HZ-GB-2312\r\n  - GB-18030\r\n\r\n- Cyrillic\r\n  - ISO-8859-5\r\n  - KOI8-R\r\n  - WINDOWS-1251\r\n  - MACCYRILLIC\r\n  - IBM866\r\n  - IBM855\r\n\r\n- Greek\r\n  - ISO-8859-7\r\n  - WINDOWS-1253\r\n\r\n- Hebrew\r\n  - ISO-8859-8\r\n  - WINDOWS-1255\r\n\r\n- Japanese\r\n  - ISO-2022-JP\r\n  - Shift_JIS\r\n  - EUC-JP\r\n\r\n- Korean\r\n  - ISO-2022-KR\r\n  - EUC-KR\r\n\r\n- Unicode\r\n  - UTF-8\r\n  - UTF-16BE / UTF-16LE\r\n  - UTF-32BE / UTF-32LE / X-ISO-10646-UCS-4-3412 / X-ISO-10646-UCS-4-2143\r\n\r\n- Others\r\n  - WINDOWS-1252\r\n  - US-ASCII\r\n\r\nAll supported encodings are listed in ``org.mozilla.universalchardet.Constants.``\r\n\r\n\r\n## How to use it\r\n\r\n(1) Construct an instance of ``org.mozilla.universalchardet.UniversalDetector``.\r\n\r\n(2) Feed some data (typically some thousand bytes) to the detector\r\n    using ``UniversalDetector.handleData()``.\r\n    \r\n(3) Notify the detector of the end of data by using\r\n    ``UniversalDetector.dataEnd()``.\r\n    \r\n(4) Get the detected encoding name by using\r\n    ``UniversalDetector.getDetectedCharset()``.\r\n    \r\n(5) Don't forget to call ``UniversalDetector.reset()`` before you reuse\r\n    the detector instance for another guess.\r\n\r\n\r\n------------ Sample Code ------------\r\n\r\n```java\r\nimport org.mozilla.universalchardet.UniversalDetector;\r\n\r\npublic class TestDetector\r\n{\r\n  public static void main(String[] args)\r\n  {\r\n    byte[] buf = new byte[4096];\r\n    java.io.InputStream fis = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(\"test.txt\"));\r\n\r\n    // (1)\r\n    UniversalDetector detector = new UniversalDetector();\r\n\r\n    // (2)\r\n    int nread;\r\n    while ((nread = fis.read(buf)) \u003e 0 \u0026\u0026 !detector.isDone()) {\r\n      detector.handleData(buf, 0, nread);\r\n    }\r\n    // (3)\r\n    detector.dataEnd();\r\n\r\n    // (4)\r\n    String encoding = detector.getDetectedCharset();\r\n    if (encoding != null) {\r\n      System.out.println(\"Detected encoding = \" + encoding);\r\n    } else {\r\n      System.out.println(\"No encoding detected.\");\r\n    }\r\n\r\n    // (5)\r\n    detector.reset();\r\n  }\r\n}\r\n```\r\n\r\n### Detecting encoding of a File (simple way)\r\n\r\n```java\r\n\r\nimport org.mozilla.universalchardet.UniversalDetector;\r\n\r\npublic class TestDetectorFile {\r\n\r\n\tpublic static void main (String[] args) throws java.io.IOException {\r\n\t\tif (args.length != 1) {\r\n\t\t\tSystem.err.println(\"Usage: java TestDetectorFile FILENAME\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\tjava.io.File file = new java.io.File(args[0]);\r\n\t\tString encoding = UniversalDetector.detectCharset(file);\r\n\t\tif (encoding != null) {\r\n\t\t\tSystem.out.println(\"Detected encoding = \" + encoding);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No encoding detected.\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n```\r\n\r\n### Creating a reader with correct encoding\r\n\r\n\r\n```java\r\n\r\nimport org.mozilla.universalchardet.ReaderFactory;\r\n\r\npublic class TestCreateReaderFromFile {\r\n\t\r\n\tpublic static void main (String[] args) throws java.io.IOException {\r\n\t\tif (args.length != 1) {\r\n\t\t\tSystem.err.println(\"Usage: java TestCreateReaderFromFile FILENAME\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t\r\n\t\tjava.io.Reader reader = null;\r\n\t\ttry {\r\n\t\t\tjava.io.File file = new java.io.File(args[0]);\r\n\t\t\treader = ReaderFactory.createBufferedReader(file);\r\n\t\t\t\r\n\t\t\t// Do whatever you want with the reader\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tif (reader != null) {\r\n\t\t\t\treader.close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n}\r\n\r\n```\r\n\r\n\r\n## Getting with maven\r\n\r\nPut this dependency in your pom.xml\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003ecom.github.albfernandez\u003c/groupId\u003e\r\n\t\u003cartifactId\u003ejuniversalchardet\u003c/artifactId\u003e\r\n\t\u003cversion\u003e2.5.0\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n\r\n```\r\n\r\n## Getting with gradle\r\n\r\nPut this line in your build.gradle\r\n\r\n```groovy\r\nimplementation 'com.github.albfernandez:juniversalchardet:2.5.0'\r\n```\r\n\r\n## Building from sources\r\n\r\n```bash\r\n    git clone https://github.com/albfernandez/juniversalchardet.git\r\n    cd juniversalchardet\r\n    mvn clean package\r\n```\r\n\r\n## Related Works\r\n\r\n- jchardet  http://jchardet.sourceforge.net/\r\n\r\njchardet is another Java port of the Mozilla's encoding dectection library.\r\nThe main difference between jchardet and juniversalchardet is modules\r\nthey are based on. jchardet is based on the \"chardet\" module that has\r\nlong existed. juniversalchardet is based on the \"universalchardet\" module\r\nthat is new and generally provides better accuracy on detection results.\r\n\r\n- juniversalchardet  https://code.google.com/archive/p/juniversalchardet/\r\n\r\nThe original repository of this project\r\n\r\n## License\r\n\r\nThe library is subject to the Mozilla Public License Version 1.1.\r\n\r\nAlternatively, the library may be used under the terms of either\r\nthe GNU General Public License Version 2 or later, or the GNU\r\nLesser General Public License 2.1 or later.\r\n\r\nSPDX-License-Identifier: MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later\r\n\r\n## Compatibility\r\n\r\n\r\njuniversalchardet 2.x requires JDK 7 or higher.\r\njuniversalchardet 3.x requieres JDK 11 or higher.\r\n\r\nFor Android:\r\n\r\n- juniversalchardet 2.0.x requires Android 4 (API Level 14)\r\n- juniversalchardet 2.1.x and newer requires Android 8 (API Level 26)\r\n\r\n- juniversalchardet 3.0.x and newer requires Android 12 (API Level 32)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbfernandez%2Fjuniversalchardet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbfernandez%2Fjuniversalchardet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbfernandez%2Fjuniversalchardet/lists"}