{"id":13697802,"url":"https://github.com/calio/iconv-nginx-module","last_synced_at":"2025-07-12T01:31:31.292Z","repository":{"id":879056,"uuid":"623023","full_name":"calio/iconv-nginx-module","owner":"calio","description":"a character conversion nginx module using libiconv","archived":false,"fork":false,"pushed_at":"2018-10-10T09:09:52.000Z","size":181,"stargazers_count":33,"open_issues_count":1,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T12:12:17.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/calio.png","metadata":{"files":{"readme":"README.markdown","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":"2010-04-22T07:20:16.000Z","updated_at":"2025-03-20T01:04:27.000Z","dependencies_parsed_at":"2022-08-16T11:25:05.823Z","dependency_job_id":null,"html_url":"https://github.com/calio/iconv-nginx-module","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/calio/iconv-nginx-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calio%2Ficonv-nginx-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calio%2Ficonv-nginx-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calio%2Ficonv-nginx-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calio%2Ficonv-nginx-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calio","download_url":"https://codeload.github.com/calio/iconv-nginx-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calio%2Ficonv-nginx-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923080,"owners_count":23683716,"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-08-02T18:01:03.043Z","updated_at":"2025-07-12T01:31:31.074Z","avatar_url":"https://github.com/calio.png","language":"C","funding_links":[],"categories":["Third Modules","Third Party Modules","Variables, JSON and extensibility"],"sub_categories":["C Modules"],"readme":"\u003c!---\nDon't edit this file manually! Instead you should generate it by using:\n    wiki2markdown.pl doc/manpage.wiki\n--\u003e\n\nName\n====\n\niconv-nginx-module\n\nTable of Contents\n=================\n\n* [Name](#name)\n* [Description](#description)\n* [Usage](#usage)\n    * [set_iconv](#set_iconv)\n    * [iconv_buffer_size](#iconv_buffer_size)\n    * [iconv_filter](#iconv_filter)\n* [Compatibility](#compatibility)\n* [Installation](#installation)\n    * [Building as a dynamic module](#building-as-a-dynamic-module)\n* [Copyright \u0026 License](#copyright--license)\n* [Changelog](#changelog)\n* [See Also](#see-also)\n\nDescription\n===========\n\nThis is a nginx module that uses libiconv to convert characters of different\nencoding. It brings the 'set_iconv' command to nginx.\n\nThis module depends on the ngx_devel_kit(NDK) module.\n\nUsage\n=====\n\nset_iconv\n---------\n\n**syntax:** *set_iconv \u0026lt;destination_variable\u0026gt; \u0026lt;from_variable\u0026gt; from=\u0026lt;from_encoding\u0026gt; to=\u0026lt;to_encoding\u0026gt;*\n\n**default:** *none*\n\n**phase:** *rewrite*\n\n[Back to TOC](#table-of-contents)\n\niconv_buffer_size\n-----------------\n\n**syntax:** *iconv_buffer_size \u0026lt;size\u0026gt;*\n\n**default:** *iconv_buffer_size \u0026lt;pagesize\u0026gt;*\n\n[Back to TOC](#table-of-contents)\n\niconv_filter\n------------\n\n**syntax:** *iconv_filter from=\u0026lt;from_encoding\u0026gt; to=\u0026lt;to_encoding\u0026gt;*\n\n**default:** *none*\n\n**phase:** *output-filter*\n\nHere is a basic example:\n\n```nginx\n\n #nginx.conf\n\n location /foo {\n     set $src '你好'; #in UTF-8\n     set_iconv $dst $src from=utf8 to=gbk; #now $dst holds 你好 in GBK\n }\n\n #everything generated from /foo will be converted from utf8 to gbk\n location /bar {\n     iconv_filter from=utf-8 to=gbk;\n     iconv_buffer_size 1k;\n     #content handler here\n }\n```\n\n[Back to TOC](#table-of-contents)\n\nCompatibility\n=============\n\nThe following versions of Nginx should work with this module:\n\n* 1.9.x (last tested: 1.9.15)\n* 1.8.x\n* 1.7.x\n* 1.6.x\n* 1.5.x\n* 1.4.x\n* 1.3.x\n* 1.2.x (last tested: 1.2.7)\n* 1.1.x (last tested: 1.1.5)\n* 1.0.x (last tested: 1.0.8)\n* 0.9.x (last tested: 0.9.4)\n* 0.8.x (last tested: 0.8.54)\n* 0.7.x (last tested: 0.7.68)\n\n[Back to TOC](#table-of-contents)\n\nInstallation\n============\n\nGet the nginx source code from [nginx.org](http://nginx.org/).\nUntar the source code and build nginx with this module.\n\n```bash\n\n wget 'http://sysoev.ru/nginx/nginx-1.9.15.tar.gz'\n tar -xzvf nginx-1.9.15.tar.gz\n cd nginx-1.9.15/\n\n git-clone http://github.com/simpl-it/ngx_devel_kit.git\n git-clone http://github.com/calio/form-input-module.git\n\n ./configure --add-module=/path/to/iconv-nginx-module/ --add-module=/path/to/ngx_devel_kit\n make -j2\n make install\n```\n\n[Back to TOC](#table-of-contents)\n\nBuilding as a dynamic module\n----------------------------\n\nStarting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the\n`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module)\ndirective, for example,\n\n```nginx\nload_module /path/to/modules/ndk_http_module.so;  # assuming NDK is built as a dynamic module too\nload_module /path/to/modules/ngx_http_iconv_module.so;\n```\n\n[Back to TOC](#table-of-contents)\n\nCopyright \u0026 License\n===================\n\nThis program is licenced under the BSD license.\n\nCopyright (c) 2010-2016, Calio \u003cvipcalio@gmail.com\u003e.\n\nCopyright (c) 2010-2016, Yichun Zhang \u003cagentzh@gmail.com\u003e.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n* Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n* Neither the name of the Taobao Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n[Back to TOC](#table-of-contents)\n\nChangelog\n=========\n\nThis module's change logs are part of the OpenResty bundle's change logs. Please see\nSee \u003chttp://openresty.org/#Changes\u003e\n\n[Back to TOC](#table-of-contents)\n\nSee Also\n========\n\n* The [OpenResty](https://openresty.org) bundle.\n\n[Back to TOC](#table-of-contents)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalio%2Ficonv-nginx-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalio%2Ficonv-nginx-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalio%2Ficonv-nginx-module/lists"}