{"id":20183667,"url":"https://github.com/glavo/java-chardet","last_synced_at":"2026-03-02T10:02:04.851Z","repository":{"id":237074625,"uuid":"793758860","full_name":"Glavo/java-chardet","owner":"Glavo","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-27T15:32:06.000Z","size":537,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T15:45:58.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Glavo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-29T20:10:33.000Z","updated_at":"2025-04-27T15:32:09.000Z","dependencies_parsed_at":"2025-04-27T15:38:55.943Z","dependency_job_id":null,"html_url":"https://github.com/Glavo/java-chardet","commit_stats":null,"previous_names":["glavo/java-chardet"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Glavo/java-chardet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fjava-chardet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fjava-chardet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fjava-chardet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fjava-chardet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glavo","download_url":"https://codeload.github.com/Glavo/java-chardet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fjava-chardet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29998074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T09:59:02.300Z","status":"ssl_error","status_checked_at":"2026-03-02T09:59:02.001Z","response_time":60,"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":[],"created_at":"2024-11-14T02:46:51.319Z","updated_at":"2026-03-02T10:02:04.820Z","avatar_url":"https://github.com/Glavo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Chardet\r\n\r\n[![Latest release](https://img.shields.io/maven-central/v/org.glavo/chardet)](https://github.com/Glavo/java-chardet/releases/latest)\r\n\r\nThis library is a fork of [albfernandez/juniversalchardet](https://github.com/albfernandez/juniversalchardet),\r\nbased on commit [5a50f8a](https://github.com/albfernandez/juniversalchardet/commit/5a50f8a067d51a9a77185b31aa2efa26280020ad).\r\n\r\nThe purpose of this library is to detect the encoding of unknown encoded text.\r\n\r\nNote: This library is in beta stage, and there may be breaking changes to the API in the future.\r\n\r\n## Differences from upstream\r\n\r\nThe main difference between this library and the upstream (and my motivation for creating this fork)\r\nis that all APIs are based on `ByteBuffer` instead of `byte[]`, so this library can directly handle off-heap memory.\r\n\r\nOf course, I've also provided `byte[]` based shorthands for these APIs, so working with `byte[]` isn't any more cumbersome.\r\n\r\nIn addition, I also did some cleaning up of the library.\r\nThe more important difference is that this library no longer uses `String` to represent encoding,\r\ninstead [DetectedCharset](src/main/java/org/glavo/chardet/DetectedCharset.java) is used.\r\nYou can convert DetectedCharset to Java `java.nio.charset.Charset` easily:\r\n\r\n```java\r\nDetectedCharset result = UniversalDetector.detectCharset(Paths.get(\"testfile.txt\"));\r\nCharset charset = result != null ? result.getCharset() : StandardCharsets.UTF_8;\r\n```\r\n\r\nThe reason for not using `Charset` directly is that this library supports detection of some encodings that Java does not support (e.g. `HZ-GB-2312`).\r\n\r\nThere are some other minor cleanups and fixes to this library. I plan to submit some patches to upstream in the future.\r\n\r\n## Adding the library to your build\r\n\r\nMaven:\r\n```xml\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003eorg.glavo\u003c/groupId\u003e\r\n  \u003cartifactId\u003echardet\u003c/artifactId\u003e\r\n  \u003cversion\u003e2.5.0\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\nGradle:\r\n```kotlin\r\nimplementation(\"org.glavo:chardet:2.5.0\")\r\n```\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 the GNU General Public License Version 2 or later,\r\nor the GNU Lesser General Public License 2.1 or later.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglavo%2Fjava-chardet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglavo%2Fjava-chardet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglavo%2Fjava-chardet/lists"}