Github user rsafonseca commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/462#discussion_r32472663
  
    --- Diff: 
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
 ---
    @@ -705,7 +705,7 @@ public ExecutionResult createFileInVR(String routerIp, 
String filePath, String f
             VmwareManager mgr = 
getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
             File keyFile = mgr.getSystemVMKeyFile();
             try {
    -            SshHelper.scpTo(routerIp, 3922, "root", keyFile, null, 
filePath, content.getBytes(), fileName, null);
    +            SshHelper.scpTo(routerIp, 3922, "root", keyFile, null, 
filePath, content.getBytes("UTF-8"), fileName, null);
    --- End diff --
    
    VR runs on a UTF-8 platform.
    If you're running this on windows and output a specific set of bytes based 
on windows' encoding, the result will be different when VR reads the file. 
UTF-8 should be used specifically in this case, since we're outputting a 
specific array of bytes to a platform with known encoding. 
Charset.defaultCharset() would only work well if the platorm it is running on 
matches that encoding which it actually is in most cases since most peeps run 
this on a modern linux distro ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to