
\begin{DoxyItemize}
\item infos = Information about iconv plugin is in keys below
\item infos/author = Markus Raab \href{mailto:elektra@libelektra.org}{\tt elektra@libelektra.\+org}
\item infos/licence = B\+SD
\item infos/provides = conv
\item infos/needs =
\item infos/placements = postgetstorage presetstorage
\item infos/status = maintained unittest libc
\item infos/description = Converts values of keys between charsets
\end{DoxyItemize}

This plugin is a filter plugin that converts between different character encodings.

Consider a user insisting on a {\ttfamily latin1} character encoding because of some old application. All other users already use, for example, {\ttfamily U\+T\+F-\/8}. For these users, the configuration files are encoded in {\ttfamily U\+T\+F-\/8}. So we need a solution for the user with {\ttfamily latin1} to access the key database with proper encoding.

On the other hand, contemplate an X\+ML file which requires a specific encoding. But the other key databases work well with the users encoding. So a quick fix for that backend is needed to feed that X\+ML file with a different encoding.

The iconv plugin provides a solution for both scenarios. It converts between many available character encodings. With the plugin’s configuration the user can change the from and to encoding. The default values of the plugin configuration are\+: {\ttfamily from} encoding will be determined at run-\/time. {\ttfamily to} encoding is {\ttfamily U\+T\+F-\/8}.

Parameters\+:


\begin{DoxyItemize}
\item {\ttfamily to} is per default U\+T\+F-\/8, to have unicode configuration files
\item {\ttfamily from} is per default the users locale
\end{DoxyItemize}

Note that for writing the configuration {\ttfamily from} and {\ttfamily to} is swapped. A key database that requires a specific encoding can make use of it. To sum up, every user can select a different encoding, but the key databases are still properly encoded for anyone.

For example {\ttfamily iconv/iconv.\+ini} should be {\ttfamily latin1}, but all users have {\ttfamily U\+T\+F-\/8} settings\+:

``{\ttfamily  @section autotoc\+\_\+md283 Mount the file}iconv/iconv.\+ini{\ttfamily using the}mini{\ttfamily plugin together with}iconv` sudo kdb mount \char`\"{}\$\+P\+W\+D/src/plugins/iconv/iconv/iconv.\+ini\char`\"{} system/tests/iconv mini iconv from=U\+T\+F-\/8,to=I\+S\+O-\/8859-\/1\hypertarget{autotoc_md280_autotoc_md284}{}\section{Check the file type of the mounted file}\label{autotoc_md280_autotoc_md284}
file -\/b \char`\"{}`kdb file system/tests/iconv`\char`\"{} \#$>$ I\+S\+O-\/8859 text

kdb get system/tests/iconv/a \# converts I\+S\+O-\/8859 to U\+T\+F-\/8 \#$>$ hellö

kdb set system/tests/iconv/a öäß \# converts U\+T\+F-\/8 to I\+S\+O-\/8859 kdb get system/tests/iconv/a \#$>$ öäß\hypertarget{autotoc_md280_autotoc_md285}{}\section{Cleanup}\label{autotoc_md280_autotoc_md285}
kdb set system/tests/iconv/a hellö sudo kdb umount system/tests/iconv ``` 