{"id":21905325,"url":"https://github.com/pedrolcl/iconv_qt_poc","last_synced_at":"2026-04-10T01:15:23.702Z","repository":{"id":128907959,"uuid":"462301887","full_name":"pedrolcl/iconv_qt_poc","owner":"pedrolcl","description":"Integrating iconv()  for Unicode conversion with Qt apps (POC)","archived":false,"fork":false,"pushed_at":"2022-12-10T19:31:32.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-27T07:28:45.220Z","etag":null,"topics":["iconv","linux","macos","poc","qt","uchardet","unicode","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrolcl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-22T13:06:48.000Z","updated_at":"2022-05-11T19:39:07.000Z","dependencies_parsed_at":"2023-05-01T01:01:04.364Z","dependency_job_id":null,"html_url":"https://github.com/pedrolcl/iconv_qt_poc","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/pedrolcl%2Ficonv_qt_poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolcl%2Ficonv_qt_poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolcl%2Ficonv_qt_poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolcl%2Ficonv_qt_poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrolcl","download_url":"https://codeload.github.com/pedrolcl/iconv_qt_poc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918710,"owners_count":20531686,"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":["iconv","linux","macos","poc","qt","uchardet","unicode","windows"],"created_at":"2024-11-28T16:32:46.028Z","updated_at":"2025-12-30T23:51:24.807Z","avatar_url":"https://github.com/pedrolcl.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IconvQtPOC: Integrating iconv() for Unicode conversion with a Qt app (POC)\n\nThis project is a proof-of-concept for using\n[iconv(3)](https://www.unix.com/man-page/osf1/3/iconv/)\nto convert text from any charset to [Unicode](https://home.unicode.org/),\nintegrated in a Qt app.\n\n## Why this exists?\n\nQt has a convenient class:\n[QTextCodec](https://doc.qt.io/qt-5/qtextcodec.html),\nthat performs conversion between Unicode and other character sets, until Qt5.\nIn Qt6 this class was moved from QtCore to the\n[Qt5Compat module](https://doc.qt.io/qt-6/qtcore5compat-module.html),\nwhich means that it will be relegated in maintenance\npriority, and it may be totally removed in the future.\n\nDrumstick::File is a library, belonging to the\n[Drumstick project](https://drumstick.sourceforge.io/), that supports\nInput/Output from\n[Standard MIDI Files](https://www.midi.org/specifications-old/item/standard-midi-files-smf)\n(.MID), which include text metadata, like\nlyrics, comments, credits, copyrights, instruments, marks and cue names. Some\nprograms based on Drumstick (like\n[kmidimon](https://kmidimon.sourceforge.io/) and\n[dmidiplayer](https://dmidiplayer.sourceforge.io/)\n) display metadata to the users, so the text needs to be converted to Unicode.\n\n## SMF metadata\n\n[The SMF standard](https://www.midi.org/specifications-old/item/standard-midi-files-smf)\nwas created as a file interchange format, so users could export\ncompositions from one MIDI sequencer proprietary format, and import those files\ninto another sequencer. Some sequencer hardware machines and software became\ndeprecated and unusable with time, and the data files in proprietary format\nbecame unreadable, losing work unless the users kept SMF exported files. Those\nfiles should now be treated as original manuscripts for data preservation.\n\nThe authors of the standard, naively stated that all text metadata should be\nencoded in ASCII within a MIDI file, omitting the fact that many cultures exist\naround the world needing other encodings to reliable store their languages. Of\ncourse, the result was that composers, manufacturers and software developers\nall over the world ignored that standard requirement and used whatever encoding\nthat was available at the time. Nowadays, a good encoding choice is UTF-8, and\nthis is what [Rosegarden](https://www.rosegardenmusic.com/)\ndoes when exports compositions as MIDI files. But for\nimporting from MIDI files, software apps need to convert from some unknown\nencodings into Unicode for processing.\n\n## Tested solution\n\nThis project does not read SMF files. Instead, it reads plain text files with\nunknown encodings, and tries to detect the input charset using\n[uchardet](https://www.freedesktop.org/wiki/Software/uchardet/). The user has a\ncontrol to choose another charset using a combobox, if the detected one is not\ncorrect. Then, the input data is converted to Unicode by **iconv(3)** and\ndisplayed to the user.\n\nThere is another POC, functionally equivalent,\n[alternative using ICU](https://github.com/pedrolcl/icu_qt_poc).\n\nCMake minimum requirement is v3.11, because\n[FindIconv.cmake](https://cmake.org/cmake/help/v3.11/module/FindIconv.html)\nwas introduced in that version.\n\niconv() is a POSIX API, and it is included in the C library of many Unix\nsystems, like the GNU libc. This may be detected by cmake, and in this case no\nadditional library needs to be linked to the application program, but the\nexternal [libiconv](https://www.gnu.org/software/libiconv/) is also supported\nwhen needed.\n\nCharacter set detection was never provided by Qt. This POC uses the latest\nuchardet library (0.0.7 at the time of writting this), which only supports\npkg-config. A newer version will include also support for find_package()\nand imported targets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrolcl%2Ficonv_qt_poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrolcl%2Ficonv_qt_poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrolcl%2Ficonv_qt_poc/lists"}