This commit is contained in:
Julio Cesar Laura Avendaño
2017-06-23 14:27:16 -04:00
parent ca9c782d20
commit eac6bebca5
2 changed files with 9 additions and 5 deletions

View File

@@ -2970,11 +2970,10 @@ class G
*/
public function is_utf8 ($string)
{
if (is_array( $string )) {
$enc = implode( '', $string );
return @! ((ord( $enc[0] ) != 239) && (ord( $enc[1] ) != 187) && (ord( $enc[2] ) != 191));
if (preg_match('//u', $string)) {
return true;
} else {
return (utf8_encode( utf8_decode( $string ) ) == $string);
return false;
}
}

View File

@@ -506,7 +506,12 @@ class pmTablesProxy extends HttpProxyController
$j = 0;
foreach ($aAdditionalTables['FIELDS'] as $aField) {
$conData++;
$temp = (array_key_exists($j, $aAux))? '"' . addslashes(stripslashes(utf8_encode($aAux[$j]))) . '"' : '""';
if (array_key_exists($j, $aAux)) {
$temp = '"' . addslashes(stripslashes(G::is_utf8($aAux[$j]) ? $aAux[$j] : utf8_encode($aAux[$j]))) . '"';
} else {
$temp = '""';
}
if ($temp == '') {
switch ($aField['FLD_TYPE']) {