syntax either will make or break the routine
I set up the 1.48 version on a headless server because the server doesn't have the correct libs for the new version
regular call with nothing extra and hoping that the converter will do everything fine
exec("ebook-convert ".$INepub." ". $OutMobi." 2>&1 ",$output);
exec("ebook-convert ".$INepub." ". $OutMobi." --authors \"$Taname\" --publisher \"$pub\" --comments \"$comments\" --tags \"$tags\" --pubdate \"$pubdate\" --isbn \"$spidout\" --title \"$Ttitle\" 2>&1 ",$output);
The important part about this routine is that if you have any spaces in a string , you must escape the var or it will crash
AS well it does not handle UTF8 coding when sending so you have to strip any of that out from the var ahead of time
I use a function like this to do that
function ITSconvertchars( $str )
{
$str = str_replace( 'À', 'A', $str );
$str = str_replace( 'Á', 'A', $str );
$str = str_replace( 'Â', 'A', $str );
$str = str_replace( 'Ã', 'A', $str );
$str = str_replace( 'Ä', 'A', $str );
$str = str_replace( 'Å', 'A', $str );
$str = str_replace( 'Æ', 'A', $str );
$str = str_replace( 'Ç', 'C', $str );
$str = str_replace( 'È', 'E', $str );
$str = str_replace( 'É', 'E', $str );
$str = str_replace( 'Ê', 'E', $str );
$str = str_replace( 'Ë', 'E', $str );
$str = str_replace( 'Ì', 'I', $str );
$str = str_replace( 'Í', 'I', $str );
$str = str_replace( 'Î', 'I', $str );
$str = str_replace( 'Ï', 'I', $str );
$str = str_replace( 'Ð', 'D', $str );
$str = str_replace( 'Ñ', 'N', $str );
$str = str_replace( 'Ò', 'O', $str );
$str = str_replace( 'Ó', 'O', $str );
$str = str_replace( 'Ô', 'O', $str );
$str = str_replace( 'Õ', 'O', $str );
$str = str_replace( 'Ö', 'O', $str );
$str = str_replace( '×', 'x', $str );
$str = str_replace( 'Ø', 'O', $str );
$str = str_replace( 'Ù', 'U', $str );
$str = str_replace( 'Ú', 'U', $str );
$str = str_replace( 'Û', 'U', $str );
$str = str_replace( 'Ü', 'U', $str );
$str = str_replace( 'Ý', 'Y', $str );
$str = str_replace( 'Þ', 'p', $str );
$str = str_replace( 'ß', 'b', $str );
$str = str_replace( 'à', 'a', $str );
$str = str_replace( 'á', 'a', $str );
$str = str_replace( 'â', 'a', $str );
$str = str_replace( 'ã', 'a', $str );
$str = str_replace( 'ä', 'a', $str );
$str = str_replace( 'å', 'a', $str );
$str = str_replace( 'æ', 'a', $str );
$str = str_replace( 'ç', 'c', $str );
$str = str_replace( 'è', 'e', $str );
$str = str_replace( 'é', 'e', $str );
$str = str_replace( 'ê', 'e', $str );
$str = str_replace( 'ë', 'e', $str );
$str = str_replace( 'ì', 'i', $str );
$str = str_replace( 'í', 'i', $str );
$str = str_replace( 'î', 'i', $str );
$str = str_replace( 'ï', 'i', $str );
$str = str_replace( 'ð', 'o', $str );
$str = str_replace( 'ñ', 'n', $str );
$str = str_replace( 'ò', 'o', $str );
$str = str_replace( 'ó', 'o', $str );
$str = str_replace( 'ô', 'o', $str );
$str = str_replace( 'õ', 'o', $str );
$str = str_replace( 'ö', 'o', $str );
$str = str_replace( '÷', '', $str );
$str = str_replace( 'ø', 'o;', $str );
$str = str_replace( 'ù', 'u', $str );
$str = str_replace( 'ú', 'u', $str );
$str = str_replace( 'û', 'u', $str );
$str = str_replace( 'ü', 'u', $str );
$str = str_replace( 'ý', 'y', $str );
$str = str_replace( 'þ', ';', $str );
// ms word replacements
$str = str_replace( '', ",", $str ); // 130 or or chr(130) =
$str = str_replace( '', 'NLG', $str ); //131 or or chr(131) =
$str = str_replace( '', '"', $str ); //132 or or chr(132) =
$str = str_replace( ' ', '...', $str ); //133 or or chr(133) =
$str = str_replace( '', '**', $str ); //134 or or chr(134) =
$str = str_replace( '', '***', $str ); //135 or or chr(135) =
$str = str_replace( '', '^', $str ); //136 or or chr(136) =
$str = str_replace( '', 'o/oo', $str ); //137 or or chr(137) =
$str = str_replace( '', 'Sh', $str ); //138 or or chr(138) =
$str = str_replace( '', '<', $str ); //139 or or chr(139) =
$str = str_replace( '', 'OE', $str ); //140 or or chr(140) =
$str = str_replace( '', "'", $str ); //145 or or chr(145) =
$str = str_replace( '', "'", $str );// 146 or or chr(146) =
$str = str_replace( '', '"', $str ); // 147 or or chr(147) =
$str = str_replace( '', '"', $str ); // 148 or or chr(148) =
$str = str_replace( '', '-', $str ); // 149 or or chr(149) =
$str = str_replace( '', '--', $str ); // 150 or or chr(150) =
$str = str_replace( '', '-', $str ); // 151 or or chr(151) =
$str = str_replace( '', '~', $str ); // 152 or or chr(152) =
$str = str_replace( '', '(TM)', $str ); // 153 or or chr(153) =
$str = str_replace( '', 'sh', $str ); // 154 or or chr(154) =
$str = str_replace( '', '>', $str ); // 155 or or chr(155) =
$str = str_replace( '', 'oe', $str ); // 156 or or chr(156) =
$str = str_replace( '', 'Y', $str ); // 159 or or chr(159) =
}
Hope this helps someone
I set up the 1.48 version on a headless server because the server doesn't have the correct libs for the new version
regular call with nothing extra and hoping that the converter will do everything fine
exec("ebook-convert ".$INepub." ". $OutMobi." 2>&1 ",$output);
exec("ebook-convert ".$INepub." ". $OutMobi." --authors \"$Taname\" --publisher \"$pub\" --comments \"$comments\" --tags \"$tags\" --pubdate \"$pubdate\" --isbn \"$spidout\" --title \"$Ttitle\" 2>&1 ",$output);
The important part about this routine is that if you have any spaces in a string , you must escape the var or it will crash
AS well it does not handle UTF8 coding when sending so you have to strip any of that out from the var ahead of time
I use a function like this to do that
function ITSconvertchars( $str )
{
$str = str_replace( 'À', 'A', $str );
$str = str_replace( 'Á', 'A', $str );
$str = str_replace( 'Â', 'A', $str );
$str = str_replace( 'Ã', 'A', $str );
$str = str_replace( 'Ä', 'A', $str );
$str = str_replace( 'Å', 'A', $str );
$str = str_replace( 'Æ', 'A', $str );
$str = str_replace( 'Ç', 'C', $str );
$str = str_replace( 'È', 'E', $str );
$str = str_replace( 'É', 'E', $str );
$str = str_replace( 'Ê', 'E', $str );
$str = str_replace( 'Ë', 'E', $str );
$str = str_replace( 'Ì', 'I', $str );
$str = str_replace( 'Í', 'I', $str );
$str = str_replace( 'Î', 'I', $str );
$str = str_replace( 'Ï', 'I', $str );
$str = str_replace( 'Ð', 'D', $str );
$str = str_replace( 'Ñ', 'N', $str );
$str = str_replace( 'Ò', 'O', $str );
$str = str_replace( 'Ó', 'O', $str );
$str = str_replace( 'Ô', 'O', $str );
$str = str_replace( 'Õ', 'O', $str );
$str = str_replace( 'Ö', 'O', $str );
$str = str_replace( '×', 'x', $str );
$str = str_replace( 'Ø', 'O', $str );
$str = str_replace( 'Ù', 'U', $str );
$str = str_replace( 'Ú', 'U', $str );
$str = str_replace( 'Û', 'U', $str );
$str = str_replace( 'Ü', 'U', $str );
$str = str_replace( 'Ý', 'Y', $str );
$str = str_replace( 'Þ', 'p', $str );
$str = str_replace( 'ß', 'b', $str );
$str = str_replace( 'à', 'a', $str );
$str = str_replace( 'á', 'a', $str );
$str = str_replace( 'â', 'a', $str );
$str = str_replace( 'ã', 'a', $str );
$str = str_replace( 'ä', 'a', $str );
$str = str_replace( 'å', 'a', $str );
$str = str_replace( 'æ', 'a', $str );
$str = str_replace( 'ç', 'c', $str );
$str = str_replace( 'è', 'e', $str );
$str = str_replace( 'é', 'e', $str );
$str = str_replace( 'ê', 'e', $str );
$str = str_replace( 'ë', 'e', $str );
$str = str_replace( 'ì', 'i', $str );
$str = str_replace( 'í', 'i', $str );
$str = str_replace( 'î', 'i', $str );
$str = str_replace( 'ï', 'i', $str );
$str = str_replace( 'ð', 'o', $str );
$str = str_replace( 'ñ', 'n', $str );
$str = str_replace( 'ò', 'o', $str );
$str = str_replace( 'ó', 'o', $str );
$str = str_replace( 'ô', 'o', $str );
$str = str_replace( 'õ', 'o', $str );
$str = str_replace( 'ö', 'o', $str );
$str = str_replace( '÷', '', $str );
$str = str_replace( 'ø', 'o;', $str );
$str = str_replace( 'ù', 'u', $str );
$str = str_replace( 'ú', 'u', $str );
$str = str_replace( 'û', 'u', $str );
$str = str_replace( 'ü', 'u', $str );
$str = str_replace( 'ý', 'y', $str );
$str = str_replace( 'þ', ';', $str );
// ms word replacements
$str = str_replace( '', ",", $str ); // 130 or or chr(130) =
$str = str_replace( '', 'NLG', $str ); //131 or or chr(131) =
$str = str_replace( '', '"', $str ); //132 or or chr(132) =
$str = str_replace( ' ', '...', $str ); //133 or or chr(133) =
$str = str_replace( '', '**', $str ); //134 or or chr(134) =
$str = str_replace( '', '***', $str ); //135 or or chr(135) =
$str = str_replace( '', '^', $str ); //136 or or chr(136) =
$str = str_replace( '', 'o/oo', $str ); //137 or or chr(137) =
$str = str_replace( '', 'Sh', $str ); //138 or or chr(138) =
$str = str_replace( '', '<', $str ); //139 or or chr(139) =
$str = str_replace( '', 'OE', $str ); //140 or or chr(140) =
$str = str_replace( '', "'", $str ); //145 or or chr(145) =
$str = str_replace( '', "'", $str );// 146 or or chr(146) =
$str = str_replace( '', '"', $str ); // 147 or or chr(147) =
$str = str_replace( '', '"', $str ); // 148 or or chr(148) =
$str = str_replace( '', '-', $str ); // 149 or or chr(149) =
$str = str_replace( '', '--', $str ); // 150 or or chr(150) =
$str = str_replace( '', '-', $str ); // 151 or or chr(151) =
$str = str_replace( '', '~', $str ); // 152 or or chr(152) =
$str = str_replace( '', '(TM)', $str ); // 153 or or chr(153) =
$str = str_replace( '', 'sh', $str ); // 154 or or chr(154) =
$str = str_replace( '', '>', $str ); // 155 or or chr(155) =
$str = str_replace( '', 'oe', $str ); // 156 or or chr(156) =
$str = str_replace( '', 'Y', $str ); // 159 or or chr(159) =
}
Hope this helps someone