[Libguestfs] [PATCH v11 03/10] daemon: utils: New functions unix_canonical_path, utf16le_to_utf8 and tests.
Pino Toscano
ptoscano at redhat.com
Tue Aug 8 16:57:43 UTC 2017
On Monday, 31 July 2017 17:40:52 CEST Richard W.M. Jones wrote:
> +let unix_canonical_path path =
> + let is_absolute = String.length path > 0 && path.[0] = '/' in
> + let path = String.nsplit "/" path in
> + let path = List.filter ((<>) "") path in
> + (if is_absolute then "/" else "") ^ String.concat "/" path
> +
> +(* Note that we cannot use iconv here because inside the appliance
> + * all i18n databases are deleted. For the same reason we cannot
> + * use functions like hivex_value_string, as they also use iconv
> + * internally.
Are you sure? The iconv data are actually copied in the appliance
(brought by glibc packages, usually) -- see also commit
e73cd348c8a2786b5e9874dd1f96cf7bc36412f2 which included them again.
A quick test here (on a sample file) using the `iconv` command line
tool in virt-rescue worked, and correctly converted the encoding.
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170808/912e9ecd/attachment.sig>
More information about the Libguestfs
mailing list