2010/10/14 Daniel Veillard <veillard@xxxxxxxxxx>: > On Thu, Oct 14, 2010 at 08:59:18AM +0200, Matthias Bolte wrote: >> --- >> Âsrc/esx/esx_vmx.c                 Â|  Â3 +++ >> Âtests/xml2vmxdata/xml2vmx-annotation.vmx      |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-cdrom-ide-device.vmx   |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-cdrom-ide-file.vmx    |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-cdrom-scsi-device.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-cdrom-scsi-file.vmx   Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-esx-in-the-wild-1.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-esx-in-the-wild-2.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-esx-in-the-wild-3.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-esx-in-the-wild-4.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-bridged.vmx   |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-custom.vmx   Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-e1000.vmx    |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-generated.vmx  |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-other.vmx    |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-static.vmx   Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-vmxnet2.vmx   |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-ethernet-vpx.vmx     |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-floppy-device.vmx    Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-floppy-file.vmx     Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-graphics-vnc.vmx     |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-gsx-in-the-wild-1.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-gsx-in-the-wild-2.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-gsx-in-the-wild-3.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-gsx-in-the-wild-4.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-harddisk-ide-file.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-harddisk-scsi-file.vmx  |  Â1 + >> Âtests/xml2vmxdata/xml2vmx-minimal-64bit.vmx    Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-minimal.vmx       Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-parallel-device.vmx   Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-parallel-file.vmx    Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-scsi-driver.vmx     Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-scsi-writethrough.vmx  Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-serial-device.vmx    Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-serial-file.vmx     Â|  Â1 + >> Â.../xml2vmxdata/xml2vmx-serial-network-client.vmx Â|  Â1 + >> Â.../xml2vmxdata/xml2vmx-serial-network-server.vmx Â|  Â1 + >> Âtests/xml2vmxdata/xml2vmx-serial-pipe.vmx     Â|  Â1 + >> Â38 files changed, 40 insertions(+), 0 deletions(-) >> >> diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c >> index e17e1e7..7dc8e60 100644 >> --- a/src/esx/esx_vmx.c >> +++ b/src/esx/esx_vmx.c >> @@ -2475,6 +2475,9 @@ esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def, >>     Âreturn NULL; >>   Â} >> >> +  Â/* vmx:.encoding */ >> +  ÂvirBufferAddLit(&buffer, ".encoding = \"UTF-8\"\n"); >> + >>   Â/* vmx:config.version */ >>   ÂvirBufferAddLit(&buffer, "config.version = \"8\"\n"); >> > > ÂGood idea ! Nice that they though about the need for an encoding there, > > ACK > > Now the question is do we check for encoding when reading a vmx ? > Some iconv (or maybe we can reuse libxml2 conversion functions) might > be in order. > > Daniel We currently assume that VMX files are UTF-8 encoded (that's true for ESX, at least I didn't find a counter example yet), but for example a Windows based GSX server uses Windows-1252 encoding by default. This is denoted as .encoding = "windows-1252" in the VMX file. I'm working on it. Thanks, pushed. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list