{"id":16224230,"url":"https://github.com/camertron/code-pages","last_synced_at":"2025-04-08T01:46:57.591Z","repository":{"id":59152215,"uuid":"115679382","full_name":"camertron/code-pages","owner":"camertron","description":"A database of legacy Microsoft and ISO 8859 code pages for Ruby.","archived":false,"fork":false,"pushed_at":"2018-02-06T18:01:08.000Z","size":478,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T17:04:08.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camertron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-29T02:47:45.000Z","updated_at":"2017-12-29T02:49:58.000Z","dependencies_parsed_at":"2022-09-13T11:01:10.111Z","dependency_job_id":null,"html_url":"https://github.com/camertron/code-pages","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/camertron%2Fcode-pages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camertron%2Fcode-pages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camertron%2Fcode-pages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camertron%2Fcode-pages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camertron","download_url":"https://codeload.github.com/camertron/code-pages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761029,"owners_count":20991533,"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-10-10T12:23:30.333Z","updated_at":"2025-04-08T01:46:57.562Z","avatar_url":"https://github.com/camertron.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## code-pages\nA database of legacy Microsoft and ISO 8859 code pages for Ruby.\n\n## Installation\n\n`gem install code-pages`\n\nor put it in your Gemfile:\n\n```ruby\ngem 'code-pages'\n```\n\n### What is this Thing?\n\nBefore the advent of the Unicode standard, Microsoft and other companies developed their own encoding systems to accommodate the world's many languages and writing systems. Like Unicode, each of these systems map a series of integers to characters. A group of these characters is called a code page, and a number of legacy systems still use them to represent text. Fortunately the Unicode Consortium maintains a set of data files mapping the characters used in each code page to their Unicode equivalents, making it possible to convert text from the various code page encodings to UTF-8.\n\n### Usage\n\nIndividual code pages can be accessed directly via the `CodePages` constant:\n\n```ruby\nCodePages[37]  # =\u003e #\u003cCodePages::CodePage:0x00007fcd1c374dd0 @id=37 ... \u003e\n```\n\nGet a list of all code pages via the `#all` method:\n\n```ruby\nCodePages.all  # =\u003e { 37 =\u003e #\u003cCodePages::CodePage:0x00007fb23d1c92c8 @id=37 ... \u003e, ... }\n```\n\nOnce you have a code page, a mapping of code page characters to Unicode code points can be obtained via the `#unicode_mapping` method:\n\n```ruby\nCodePages[37].unicode_mapping  # =\u003e { 0=\u003e0, 1=\u003e1, 2=\u003e2, 3=\u003e3, 4=\u003e156, 5=\u003e9, ... }\n```\n\nYou can also convert text encoded with the code page to UTF-8 and vice-versa:\n\n```ruby\nCodePages[37].to_utf8('abc')    # =\u003e '/ÂÄ'\nCodePages[37].from_utf8('/ÂÄ')  # =\u003e 'abc'\n```\n\n## Updating Code Pages\n\nThe library comes with a rake task for downloading and updating the code pages from the Unicode Consortium's website. Run `bundle exec rake import` to update. To add additional code pages, edit resources/code_page_manifest.yml and run the rake task.\n\n## License\n\nLicensed under the MIT license. See LICENSE for details.\n\n## Authors\n\n* Cameron C. Dutro: http://github.com/camertron\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamertron%2Fcode-pages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamertron%2Fcode-pages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamertron%2Fcode-pages/lists"}