Don't actually know what's legal.. I pass this to the conversion class Iconv from the ruby library.
Well, "UTF-8" works and that's all I care for
Also I don't know how to detect the right answer..
You mean regarding setting S3SYNC_NATIVE_CHARSET automatically to the "correct" value?
If you have a look at how the locale is set up (ie. to what values the environment variables LANG and LC_* are set), you could induce what the "correct" value would be. If it's set to POSIX or C, it would be US-ASCII; if it's set to something like de_DE.utf-8 (or de_DE.utf8), it would be UTF-8. Other possible values would be something like en_US.ISO8859-1 which would be for ISO-8859-1. Etc. pp.. Basically, the locale setting would also tell, what character encoding is used.
HOWEVER: It would still be
very useful, if there were a way to override the automatically detected value.
Best regards,
Alexander