Foreign characters encoding in Powerstore 3
Hi,
Using utf-8 character encoding in the pages and utf8_unicode_ci on the SQL Server side, storing foreign language special characters in the database results in a multiple character string (e.g.: “é” results in “é“).
In POWERSTORE 3 code (e.g.: /Admin/Products_Results.php) the substr() function is used (in this case associated with the PHP strip_tags() function, like shown below:
<td><?php echo substr(strip_tags($row_WADAProducts['ProductShortDesc']), 0 , 23); ?>
<?php if (strlen($row_WADAProducts['ProductShortDesc']) > 23) { echo "..."; } ?></td>
If the “WADAProducts['ProductShortDesc']” contain an “é” and this special character is on position 23 of the string, the the substr() function strips the © of the é (which is how the “é” is stored in the database) and the result displayed in the browser is nothing else but a “nice and confusing” �.
Does anybody have an idea how to solve that problem while retaining charset=utf-8 on the page level and utf8_unicode_ci for the database, the tables and the varchar fields.
One solution would be the use of charset=ISO-8859-1 on the page level but this is not what I want, since I need a broader character compatibility (mixing several foreign languages) and utf-8 appears to be just right !!!
Many thanks in advance
Dan