Print Page | Close Window

UTF-8, ANSI Coding.

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1961
Printed Date: 27-September-2024 at 2:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: UTF-8, ANSI Coding.
Posted By: JWL
Subject: UTF-8, ANSI Coding.
Date Posted: 08-September-2008 at 9:31am
The .asp pages seem to be coded with ANSI, which causes (tm) and (r) signs to not display when the browser is using the more common a UTF-8 character mode.

I have tried converting the asp pages to UTF-8 using notepad, and the results are like 50/50.  Now when the browser both IE7 and FF3 are in UTF-8 mode, they display the (tm) and (r) like 50% of the time, the other half it's the invalid sign in place of these symbols.

How, can I convert these pages to UTF-8, so they function 100% when browser is set to UTF-8.



Replies:
Posted By: Matt
Date Posted: 08-September-2008 at 10:24am
You can add this to the <head> section of your HTML:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


Posted By: Greg Dinger
Date Posted: 08-September-2008 at 10:38am
I ran into this exact problem on http://www.euphoriababy.com - http://www.euphoriababy.com , but besides what JWL mentions, it also treats spaces, line breaks and such to be presented as little boxes. 
 
The client has discovered that if she over-types spaces and line breaks in order to resolve these characters (using the built-in HTML editor), then goes back later and edits the product without touching the description, the little boxes appear again.  Very frustrating. (And I do have the UTF-8 statement present in the header.)


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: macleather
Date Posted: 08-September-2008 at 6:00pm
I'm experiencing a similar problem. If I use &frac12; in order to get 1/2 all is fine until I edit the product again at which time I get an A with a circle above it instead of the 1/2 even though the actual 1/2 shows in the description before I save the changes. This happens with all of the & codes except &quote; I also get the A with circle for spaces either typed or &nbsp; as Greg indicates. I do not have the UTF-8 statement in my header.

Alan


Posted By: Greg Dinger
Date Posted: 08-September-2008 at 6:04pm
Alan, could you throw that UTF-8 statement into the header so we can determine if that resolves the issue or begins to reveal a wider pattern please?

-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: macleather
Date Posted: 08-September-2008 at 6:35pm
Greg, I put the UTF-8 statement into my header and it seems to have solved my problem. I edited a couple of items with the problems and they stuck. In other words, it held the values once input. Since I'm not a programmer and don't understand the UTF-8 etc, I copied it from Matt's example and placed in at the first line after the opening Head tag in header.asp

Alan


Posted By: Greg Dinger
Date Posted: 08-September-2008 at 6:48pm
Excellent.  Thanks.
 
FYI:
http://en.wikipedia.org/wiki/UTF-8 - http://en.wikipedia.org/wiki/UTF-8


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: JWL
Date Posted: 09-September-2008 at 6:56am
Originally posted by Matt Matt wrote:

You can add this to the <head> section of your HTML:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


I put that in the header, before I even created this thread, and it didn't work for me.  Although, I was hoping it would.  And Greg is right about the spaces, same here - they have a little box as well.

Like I said... before I converted these .asp pages to UTF-8 - I always got the invalid symbol in place of (tm) (r) etc.  But, now that I have converted like the configureprd.asp, viewprd.asp etc pages to UTF-8 - when the browser is set to UTF-8 in both IE7 and FF3, the (tm) (rm) 'spaces' etc display properly - but only like 50% of the time, the other half I still get the invalid symbol.  Even, after putting that meta tag in the header file.

It's weird... I wonder if I need to convert every .asp include that these pages pull in - to UTF-8 as well, like the header.asp, footer.asp etc.


Posted By: JWL
Date Posted: 09-September-2008 at 7:11am
I see that you have this in the adminheader.asp file:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

I don't understand why you encoded all the .asp pages in ISO-8859-1 or ANSI which is closely related.  You should have used a unicode, shame on you.  :P

Anyway, I know how I could solve the problem - I've never had this problem before and I know why... we always use "&reg;" and "&#153;" for (tm) and (r) symbols but when we input those in the admin panel, when we save the product info, it converts them to the displayed symbols... if I changed the charset in the adminheader to UTF-8, would it keep the original code of these symbols instead of converting them?

Edit: I've been told that I need to convert all the .asp file includes like header.asp, footer.asp etc to UTF-8 and that's why the characters don't always display properly even though the main pages are encoded in UTF-8.  Any thoughts?

Thanks.




Posted By: Matt
Date Posted: 09-September-2008 at 9:40pm
You do not need to re-encode the files. There are stores using Western, Hebrew, Chinese, etc...  They all rely on the correct meta data for the type of characters they are displaying.

The symbols you need can be created with ISO-8859.

http://htmlhelp.com/reference/charset/iso160-191.html

Using the original files add the following tag to your <head> section:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

If you were using the characters from the UTF-8 character set then your UTF-8 meta tag would have worked. So I suspect you just need ISO-8859.  This works on our demo store.

If you want to preserve special characters then type them directly into the text box, instead of into the HTML editor.

We hope this helps.


Posted By: JWL
Date Posted: 09-September-2008 at 11:35pm
I'm using the TM and R symbols, those should be recognized by UTF-8, no?  I mean if I write them like this, &reg; and &#153; - than they will show up in both UTF-8 and ISO-5589.

But, anyway - I went on Dell's site, and they have the UTF-8 meta, and when I switch my browser to ISO-8859 on their site, their TM and R's signs mess up.  They only work in UTF-8... and that's what we want.  Here is a sample page:

http://www.dell.com/content/topics/global.aspx/corp/pressoffice/en/2008/2008_09_08_rr_000?c=us&l=en&s=corp

Switch to ISO-5589 and you will see the TM and R, with foreign marks next to them.  I know you should be able to display TM and R in UTF-8, and that's what we need.  Converting the .asp files to UTF-8 helped some... because the TM and R will display when the browser is set to UTF-8, but the problem is that it doesn't happen everytime, only like 50% of the time.  The other half of the time, the TM and R have the invalid symbol, even though the browser is still set to UTF-8, see it doesn't make any sense.  The TM and R should show up everytime since we changed the encoding to UTF-8.  ARGH!  It's aggravating, because on our configuration pages, we use a lot of these TM and R - and the page looks like crap with all these invalid symbols.


Posted By: ProductCart
Date Posted: 09-September-2008 at 11:43pm
You can try the suggestion in the following FAQ and see if it works for you:
 
http://www.earlyimpact.com/faqs/e-commerce_shopping_cart_questions.asp?faqid=525 - http://www.earlyimpact.com/faqs/e-commerce_shopping_cart_questions.asp?faqid=525


-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software


Posted By: Matt
Date Posted: 10-September-2008 at 12:55am
Hi Jwl, I understand you are getting frustrated.  The recommendation I gave you is what I would consider the easiest way.   I tested it on our demo store. Trying to re-encode the page is a lot more work than is needed and may lead to other problems. Ultimately, you can display a trademark in UTF-8 or ISO-5589.  The character you use just has to match the declaration. 

I think the problem you were first explaining is that your &reg was being converted by the HTML editor.  To retain the &reg you need to type into the text box and not the HTML editor.  Then you can use UTF-8.

On the other hand, if you use the HTML editor and it is being converted you should use ISO-8859. 

So I recommend that you try one or the other.  Make sure the character you saved match te page declaration.  That works on our demo store and it will work for you as well.


Posted By: JWL
Date Posted: 10-September-2008 at 1:28pm
Hi, no - originally... I did put the &reg; when creating - for instance the BTO items, but even when you put this type of code &#153; in the "name" or "description" boxes, when you save the updates to the BTO item, it converts this code to the actual (tm) (r) symbols.

I understand, what you are saying about the html editor, but we're not using that to input the &reg; and &#153; code into the BTO description and title - we are using the basic editor.

If we could get these codes to stay as is without converting to the actual symbols - than yes... problem would be solved, because that's how we do the (tm) and (r) symbols on the rest of our pages.

Are you saying you have put the &reg; and &#153; code on a BTO item, and when you save the info - it doesn't convert these to the actual symbols?


Posted By: JWL
Date Posted: 27-September-2008 at 1:49am
EUREKA!  I figured out how to make it work.  Instead of trying to convert all the pages
to UTF-8... you just put the meta tag - but put it for the encoding in which the pages
are already encoded which is: ISO8859-1.  So put this tag in the header.
<meta http-equiv="Content-Type" content="text/html; charset=ISO8859-1" />

That's all you have to do to get rid of all the (r) and (tm) invalid symbols.

See, in IE7 - I think the browser automatically detects the encoding of the page
even without a meta tag, but in FF3 - the default encoding is set at UTF-8 and
unless you specify a meta tag FF won't switch to the proper encoding of the
page and thus you get the invalid character symbols.

WOW... this was so aggravating me... and, it was so simple to fix. I was
wondering why FF didn't auto-detect the page encoding, like IE7 does - but,
regardless - all you need to do is use the above meta-tag to tell FF3 which
encoding to use for the page and FF3 will switch to that encoding.

WIN!


Posted By: inetbizo
Date Posted: 28-September-2008 at 9:31pm
Originally posted by Matt Matt wrote:

You do not need to re-encode the files. There are stores using Western, Hebrew, Chinese, etc...  They all rely on the correct meta data for the type of characters they are displaying.

The symbols you need can be created with ISO-8859.

http://htmlhelp.com/reference/charset/iso160-191.html

Using the original files add the following tag to your <head> section:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

If you were using the characters from the UTF-8 character set then your UTF-8 meta tag would have worked. So I suspect you just need ISO-8859.  This works on our demo store.

If you want to preserve special characters then type them directly into the text box, instead of into the HTML editor.

We hope this helps.
Can you use a code bbc format and list orders to indicate to newbies who might not know how to edit like we do or produce a wiki doc on ISO character standards and how to implement them?

-------------
Current Project http://canvasusa.com - http://www.canvasusa.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net