Github user rsafonseca commented on the pull request:

    https://github.com/apache/cloudstack/pull/460#issuecomment-112232241
  
    Here's an example of an instance where i also removed a 
Charset.defaultCharset() that was placed in the reading of a socket, where 
cloudstack controls both ends -> 
https://github.com/apache/cloudstack/pull/400/files
    If ConsoleProxyCmdHandler.java would run on a different encoding, you might 
have issues, so i changes all classes that used this to use UTF-8 explicitly. 
Charset.defaultCharset() should still work on 
CitrixConsoleProxyLoadCommandWrapper.java (if this runs on the agent side, 
didn't check) since platform that Xenserver  runs on also uses UTF-8 as a 
default.. but in the off chance the sysadmin screwed with the java defaults or 
this isn't running on the agent side, it might then fail.. this ensures it 
would work properly no matter what, it's always safer to do this if you control 
both the reader and the writer.
    
    And here's an example where i think it's most suited to use 
Charset.defaultCharset() , the output of a shell command:
    https://github.com/apache/cloudstack/pull/396
    
    It's also possible to screw with the output of this from the system's side 
(although very unlikely), but this is the best approximation of 100% fail-proof 
of getting proper encoding of the input data.



---
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