{"id":13451451,"url":"https://github.com/goodsign/icu","last_synced_at":"2026-03-11T09:04:09.210Z","repository":{"id":5893550,"uuid":"7111911","full_name":"goodsign/icu","owner":"goodsign","description":"Cgo binding for icu4c library","archived":false,"fork":false,"pushed_at":"2017-03-29T16:17:26.000Z","size":148,"stargazers_count":23,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-12T18:41:59.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/goodsign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-11T13:09:41.000Z","updated_at":"2025-01-13T20:03:43.000Z","dependencies_parsed_at":"2022-08-28T13:31:30.141Z","dependency_job_id":null,"html_url":"https://github.com/goodsign/icu","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/goodsign%2Ficu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Ficu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Ficu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goodsign%2Ficu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goodsign","download_url":"https://codeload.github.com/goodsign/icu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245149645,"owners_count":20568942,"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-07-31T07:00:54.052Z","updated_at":"2025-12-16T00:35:54.185Z","avatar_url":"https://github.com/goodsign.png","language":"Go","readme":"About\n==========\n\nCgo binding for icu4c C library detection and conversion functions. Guaranteed compatibility with version 50.1.\n\nInstallation\n==========\n\nInstallation consists of several simple steps. They may be a bit different on your target system (e.g. require more permissions) so adapt them to the parameters of your system.\n\n### Install build-essential\n\nMake sure you have **build-essential** installed. Otherwise icu would fail on the configuration stage.\n\nInstallation example using apt-get (Ubuntu):\n\n```\nsudo apt-get install build-essential\n```\n\n### Install pkg-config\n\nMake sure you have **pkg-config** installed.\n\nInstallation example using apt-get (Ubuntu):\n\n```\nsudo apt-get install pkg-config\n```\n\n### Get icu4c C library code\n\nDownload and unarchive original icu4c archive from [icu download section](http://site.icu-project.org/download).\n\nExample (for version 50.1):\n\n```\nwget http://download.icu-project.org/files/icu4c/50.1/icu4c-50_1-src.tgz\ntar -zxvf icu4c-50_1-src.tgz\nmv -i ./icu ~/where-you-store-libs\n```\n\nNOTE: If this link is not working or there are some problems with downloading, there is a stable version 50.1 snapshot saved in [Github Downloads](https://github.com/downloads/goodsign/icu/icu4c-50_1-src.tgz).\n\n### Build and install icu4c C library\n\nFrom the directory, where you unarchived icu4c, run:\n\n```\ncd source\n./configure\nmake\nsudo make install\nsudo ldconfig\n```\n\n### Install Go wrapper\n\n```\ngo get github.com/goodsign/icu\ngo test github.com/goodsign/icu (must PASS)\n```\n\nInstallation notes\n==========\n\n* Make sure that you have your local library paths set correctly and that installation was successful. Otherwise, **go build** or **go test** may fail.\n\n* icu4c is installed in your local library directory (e.g. **/usr/local/lib**) and puts its libraries there. This path should be registered in your system (using ldconfig or exporting LD_LIBRARY_PATH, etc.) or the linker would fail.\n\n* icu4c installs its header files to local include folders (e.g. **/usr/local/include/unicode**) so there is no need to have additional .h files with this package, but the system must be properly set up to detect .h files in those directories.\n\nUsage\n==========\n\nNote: check icu documentation for returned encoding identifiers.\n\nDetector\n----------\n\n```go\n// Create detector\ndetector, err := NewCharsetDetector()\n    \nif err != nil {\n    //... Handle error ...\n}\ndefer detector.Close()\n\n// Guess encoding\nencMatches, err := detector.GuessCharset(encodedText)\n\nif err != nil {\n    //... Handle error ...\n}\n\n// Get charset with max confidence (goes first)\nmaxenc := encMatches[0].Charset\n\n// Use maxenc. \n// ...\n```\n\nConverter\n----------\n\n```go\n...\n\n// Create converter\nconverter := NewCharsetConverter(DefaultMaxTextSize)\n\n// Convert to utf-8\nconverted, err := converter.ConvertToUtf8(encodedText, maxenc)\n\nif nil != err {\n    //... Handle error ...\n}\n```\n\nUsage notes\n==========\n\n* Check **NewCharsetConverter** func comments for details on max text size parameter.\n* Often you would use detector and converter in pair. So, the 'converter' usage example actually continues the 'detector' example and uses the 'maxenc' result from it.\n\nMore info\n----------\n\nFor more information on icu refer to the original [website](http://site.icu-project.org/), which contains links on theory and other details.\n\nicu4c Licence\n==========\n\nICU is released under a nonrestrictive open source license that is suitable for use with both commercial software and with other open source or free software.\n\n[LICENCE file](https://github.com/goodsign/icu/blob/master/LICENCE_icu)\n\nLicence\n==========\n\nThe goodsign/icu binding is released under the [BSD Licence](http://opensource.org/licenses/bsd-license.php)\n\n[LICENCE file](https://github.com/goodsign/icu/blob/master/LICENCE)","funding_links":[],"categories":["Natural Language Processing","自然语言处理","Relational Databases","Bot Building","\u003cspan id=\"自然语言处理-natural-language-processing\"\u003e自然语言处理 Natural Language Processing\u003c/span\u003e"],"sub_categories":["Translation","Uncategorized","暂未分类","Advanced Console UIs","Strings","翻译","暂未分类这些库被放在这里是因为其他类别似乎都不适合。","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodsign%2Ficu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodsign%2Ficu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodsign%2Ficu/lists"}