{"id":18573028,"url":"https://github.com/buganini/bsdconv","last_synced_at":"2025-04-10T07:31:45.265Z","repository":{"id":543966,"uuid":"173961","full_name":"buganini/bsdconv","owner":"buganini","description":"A simple but powerful DSL for charset/encoding conversion and transformation, pure C implementation with no extra dependencies","archived":false,"fork":false,"pushed_at":"2023-01-10T16:50:11.000Z","size":10997,"stargazers_count":53,"open_issues_count":6,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T13:58:08.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bsdconv.io/bsdconv/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"apache/maven-doxia-tools","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buganini.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","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":"2009-04-12T08:10:20.000Z","updated_at":"2024-09-30T09:35:44.000Z","dependencies_parsed_at":"2023-01-13T16:21:57.988Z","dependency_job_id":null,"html_url":"https://github.com/buganini/bsdconv","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buganini%2Fbsdconv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buganini%2Fbsdconv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buganini%2Fbsdconv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buganini%2Fbsdconv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buganini","download_url":"https://codeload.github.com/buganini/bsdconv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223430268,"owners_count":17143624,"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-11-06T23:07:53.908Z","updated_at":"2024-11-06T23:07:54.546Z","avatar_url":"https://github.com/buganini.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Documentation \u0026 Support\nhttp://www.slideshare.net/buganini/bsdconv\n\nhttp://www.slideshare.net/Buganini/journey-of-bsdconv\n\nAPI Reference: http://buganini.github.io/bsdconv/\n\nUse bsdconv-man to show manual page for each module\n\nIRC: irc://irc.freenode.net#bsdconv\n\n# Compilation \u0026 Installation\n```\nmake PREFIX=${prefix} # default to /usr/local\nsudo make install PREFIX=${prefix} # default to /usr/local\nsudo ldconfig ${prefix}/lib # Linux\nsudo ldconfig -m ${prefix}/lib # FreeBSD\n```\n\n# Add codec alias\n```\nUpdate modules/{from,inter,to}/alias\nmake alias\n```\n\n# Example\n\nConvert traditional chinese big5 to simplified chinese utf-8\n```\nbsdconv big5:zhcn:utf-8 in.txt \u003e out.txt\nbsdconv big5:zhcn:utf-8 -i in.txt #inplace\n```\n\nConvert traditional chinese utf-8 to simplified chinese GB2312 with transliteration\n```\nbsdconv utf-8:zhcn:cp936,cp936-trans in.txt \u003e out.txt\n```\n\nConvert simplified chinese to traditional chinese\n\n```\nbsdconv utf-8:zhtw:zhtw-words:utf-8\n```\n\nAnd ignoring whitespaces mixed in words\n```\nbsdconv utf-8:whitespace-derail:zhtw:zhtw-words:whitespace-rerail:utf-8\n```\n\nConvert big5 data, traditional chinese to simplified chinese,\nCRLF/CR/LF to CRLF, to big5 data, translate simplified chinese words, which are\nnot in big5, to HTML entities, and uppercase the ascii characters.\n```\nbsdconv big5:zhcn:win:upper:big5,htmlentity in.txt \u003e out.txt\n```\n\nCounting character width\n```\necho -n \"aａ\" | bsdconv utf-8:width:null\nFULL: 1\nHALF: 1\n\necho -n \"aａˇ\" | bsdconv utf-8:width:null\nFULL: 1\nHALF: 1\nAMBI: 1\n```\n\nVery useful for migrating MySQL DB from Big5 to UTF-8\n```\nbsdconv htmlentity,big5-5c,big5:utf-8 in.sql \u003e out.sql\n```\n\nRecover from mis-decoding/encoding (mistreated big5 as iso-8859-1 and converted to utf-8)\n```\nbsdconv 'utf-8:iso-8859-1|big5:utf-8'\n```\n\nDecode escaped data (byte/unicode mixed) like %u9644%20\n```\nbsdconv 'escape,byte:unicode,byte|skip,ascii:utf-8'\n```\n\nGenerate string for fuzzy comparison\n```\necho ¼ℌăǅⓐ⁹灣湾ド鬒鬒æß | bsdconv UTF-8:ZH-FUZZY-TW:KANA-PHONETIC:NFKD-CASEFOLD:UTF-8\n    1⁄4hădža9灣灣do鬒鬒æss\n```\n\nTranslate text to HTML \u003cIMG /\u003e\n```\nbsdconv big5:nl2br:ascii,html-img in.txt \u003e out.htm\n```\n\nUse glyph image from http://www.cns11643.gov.tw\n```\nbsdconv utf-8:ascii,ascii-html-cns11643-img in.txt out.htm\n```\n\nMaintain inter map:\n```\nbsdconv bsdconv-keyword,bsdconv:bsdconv-keyword,utf-8 inter/FOO.txt \u003e edit.tmp\nvi edit.tmp\nbsdconv bsdconv-keyword,utf-8:bsdconv-keyword,bsdconv edit.tmp \u003e inter/FOO.txt\n```\n\n# Windows\nUse mingw with Makefile.win to build it, then copy everythings in build/ to c:\\bsdconv\\\nthe path of the executable will be c:\\bsdconv\\bsdconv.exe\n\nIf you want to install to directory other than default path\nset BSDCONV_PATH environment variable to your path.\n\nRun setEnvVar.bat as administrator could help you set proper environment variables.\n\n# Bindings\n[Python](https://pypi.python.org/pypi/bsdconv/ \"Python\")\n\n[Perl](https://github.com/buganini/perl-bsdconv \"Perl\")\n\n[PHP](https://github.com/buganini/php-bsdconv \"PHP\")\n\n[Ruby](https://rubygems.org/gems/ruby-bsdconv/ \"Ruby\")\n\n[Go](https://github.com/buganini/go-bsdconv \"Go\")\n\n[Java](https://github.com/buganini/jni-bsdconv \"Java\")\n\n[Haskell](https://github.com/pkmx/hs-bsdconv \"Haskell\")\n\n[Elasticsearch](https://github.com/buganini/elasticsearch-bsdconv-plugin \"Elasticsearch\")\n\n[PostgreSQL](https://github.com/buganini/postgres-bsdconv \"PostgreSQL\")\n\n[MySQL](https://github.com/buganini/mysql-udf-bsdconv \"MySQL\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuganini%2Fbsdconv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuganini%2Fbsdconv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuganini%2Fbsdconv/lists"}