I have a problem with the encoding of the text , I do not know what method I use for it so I can ssh using php write to file text with Czech characters as well as characters of other languages . The code currently looks like this :
<?php
$appname = "tést";
function prevedKodovani($string)
{
$string = iconv("utf-8", "CP852//TRANSLIT", $string);
return $string;
}
include('Net/SSH2.php');
$ssh = new Net_SSH2('ip');
if (!$ssh->login('jmeno', 'heslo')) {
exit('Login Failed');
}
echo $ssh->exec('cmd /c echo set jmeno='.prevedKodovani(utf8_encode($appname)).'>>C:\Users\server\Desktop\promnene.bat');
?>
Result in a text file :
set jmeno=t?(C)st