{"id":22728869,"url":"https://github.com/peteroupc/encoding","last_synced_at":"2025-03-30T00:28:19.335Z","repository":{"id":57727916,"uuid":"47933394","full_name":"peteroupc/encoding","owner":"peteroupc","description":"A library in C# and Java that implements character encodings used in Web pages and email.","archived":false,"fork":false,"pushed_at":"2023-10-07T11:11:39.000Z","size":2376,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-07T12:22:50.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/peteroupc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-13T19:36:44.000Z","updated_at":"2023-10-07T12:22:52.100Z","dependencies_parsed_at":"2022-08-30T09:11:00.105Z","dependency_job_id":null,"html_url":"https://github.com/peteroupc/encoding","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroupc%2Fencoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroupc%2Fencoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroupc%2Fencoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroupc%2Fencoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peteroupc","download_url":"https://codeload.github.com/peteroupc/encoding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262514,"owners_count":20749170,"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":[],"created_at":"2024-12-10T17:18:19.238Z","updated_at":"2025-03-30T00:28:19.319Z","avatar_url":"https://github.com/peteroupc.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Encoding\n=======\n\n[![NuGet Status](http://img.shields.io/nuget/v/PeterO.Encoding.svg?style=flat)](https://www.nuget.org/packages/PeterO.Encoding)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.peteroupc/encoding.svg?style=plastic)](https://search.maven.org/#search|ga|1|g%3A%22com.github.peteroupc%22%20AND%20a%3A%22encoding%22)\n\n**Download source code: [ZIP file](https://github.com/peteroupc/MailLib/archive/master.zip)**\n\n----\n\nA portable library in C# and Java that implements character encodings used in Web pages and email.\n\nIt implements the Encoding Standard, which is currently a candidate recommendation at the time of this writing.\n\nHow to Install\n---------\nThe C# implementation is available in the\nNuGet Package Gallery under the name\n[PeterO.Encoding](https://www.nuget.org/packages/PeterO.Encoding). To install\nthis library as a NuGet package, enter `Install-Package PeterO.Encoding` in the\nNuGet Package Manager Console.\n\nThe Java implementation is available\nas an [artifact](https://search.maven.org/#search|ga|1|g%3A%22com.github.peteroupc%22%20AND%20a%3A%22encoding%22) in the Central Repository. To add this library to a Maven\nproject, add the following to the `dependencies` section in your `pom.xml` file:\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.github.peteroupc\u003c/groupId\u003e\n      \u003cartifactId\u003eencoding\u003c/artifactId\u003e\n      \u003cversion\u003e0.6.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\nIn other Java-based environments, the library can be referred to by its\ngroup ID (`com.github.peteroupc`), artifact ID (`encoding`), and version, as given earlier.\n\nDocumentation\n------------\n\n**See the [Java API documentation](https://peteroupc.github.io/Encoding/api/).**\n\n**See the [C# (.NET) API documentation](https://peteroupc.github.io/Encoding/docs/).**\n\nExamples\n-------------\n\nIn C#.\n\n```\n    // Reads text from a UTF-8/UTF-16/UTF-32 file\n    public static string ReadTextFromFile(string filename) {\n      using (var stream = new FileStream(filename, FileMode.Open)) {\n        return new CharacterReader(stream, 2).InputToString();\n      }\n    }\n```\n\n```\n    // Reads text from a SHIFT-JIS stream, but uses UTF-8/UTF-16\n    // instead if it detects byte order marks\n      using (var stream = new FileStream(filename, FileMode.Open)) {\n        return Encodings.GetEncoding(\"shift_jis\")\n           .GetDecoderInputSkipBom(stream).InputToString();\n      }\n```\n\n```\n    // Writes text in UTF-8 to a file\n      using (var stream = new FileStream(filename, FileMode.Create)) {\n        var str=\"Hello world!\"\n        str.EncodeToWriter(Encodings.UTF8,stream);\n      }\n```\n\nHistory\n-----------\n\nVersion 0.6.0:\n\n- Issue fixes\n\nVersion 0.5.1:\n\n- Fixed issue in .NET 2.0 and 4.0 assemblies where resources were inadvertently left out of build.\n\nVersion 0.5.0:\n\n- Separate aliases and encodings for email are used, for better conformance to MIME.\n- New methods added to Encodings class.\n- Endian-independent UTF-16 encoding added for email.\n- ISO-2022-JP-2 and ISO-2022-KR encodings added for email.\n- .NET 2 and .NET 4 assemblies added to NuGet package.\n\nVersion 0.4.0:\n\n- Updated to latest Encoding Standard draft as of Jun. 28, 2018, except for a issue fix in one encoding.\n\nVersion 0.3.2:\n\n- Version change needed to properly refer to version.\n\nVersion 0.3.1:\n\n- Marked assembly as CLS-compliant.\n\nVersion 0.3:\n\n- Converted project to .NET Standard\n\nVersion 0.2.1:\n\n- Fix ResolveAliasForEmail method to conform to new behavior\nin version 0.2.0\n\nVersion 0.2.0:\n\n- Update implementation to latest candidate recommendation of Encoding Standard\n- ResolveAlias may return a mixed-case encoding name (as opposed to a lowercase one).\n- Add overloads to CharacterReader constructor\n- Add IReader interface\n- Deprecated some methods of DataIO\n- Add a few overloads in Encodings class, especially EncodeToWriter\n- Issue fixes\n\nVersion 0.1.0:\n\n- First release\n\nAbout\n-----------\n\nWritten by Peter O.\n\nAny copyright to this work is released to the Public Domain.\nIn case this is not possible, this work is also\nlicensed under the Unlicense: [https://unlicense.org/](https://unlicense.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteroupc%2Fencoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeteroupc%2Fencoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteroupc%2Fencoding/lists"}