close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Foreign characters encoding in Powerstore 3

Thread began 6/10/2010 3:07 am by davas56386677 | Last modified 6/11/2010 2:09 pm by Eric Mittman | 1669 views | 3 replies |

davas56386677

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” &#65533;.
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

Sign in to reply to this post

Eric Mittman

This type of update will be custom and not supported. I can think of one way that something like this could be done, if the problem is that the words are broken in between characters that need to be displayed together then maybe you can preserve the characters by looking for white space. If you can ensure that any whole values will be separated by white space then you can do a strpos to the last white space before the 23rd character. Here is a link to the strpos page on php, it has some useful info for this:

php.net/strpos

Sign in to reply to this post

davas56386677

Hi Eric

I was too lazy last night to dig into the PHP docs.
Many thanks for redirecting me to the strpos().
The matter is now solved and works fine.

Best regards

Dan

Sign in to reply to this post

Eric Mittman

I'm glad to hear that. Let us know if you have any other questions and we will help with whatever we can.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...