Special Chars Problem Solved

Feb 5, 2012 at 4:22 AM

It's very important , or even better mandatory to put this line on every html * avfp page

 

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>

Note that the charset must be the same used on visual foxpro

 You can check on this way  <%= CPCURRENT() %><br>

Using this all special chars will work, case you don't put this metatag, all characters will be passed as iso-8859 and the avfp will receive other chars than the ones you see on the page.

Cedilha up <%= 'Ç'+'a' %><br>
Cedilha low <%= 'ç' %><br>
Code Page <%= CPCURRENT() %><br>
Cedilha up <%= ASC('Ç') %><br>
Cedilha low <%= ASC('ç') %><br>

Everthing is solved with the inclusion off the head tag,

 

 

Coordinator
Feb 5, 2012 at 8:00 AM

Excellent!  Thanks for your good work!

Feb 5, 2012 at 5:15 PM

I would recomend to make this very clear on activevfp documentation

 

Coordinator
Feb 6, 2012 at 7:10 AM

I will add the following update to the Docs:

HTML: Special Characters

* thanks to "loadingpower"

Using certain special characters from some non-English languages may lead to problems.  Here's a solution:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>

Note that the charset must be the same used on visual foxpro

 You can check on this way  <%= CPCURRENT() %><br>

Using this all special chars will work, case you don't put this metatag, all characters will be passed as iso-8859 and the avfp will receive other chars than the ones you see on the page.

Cedilha up <%= 'Ç'+'a' %><br>
Cedilha low <%= 'ç' %><br>
Code Page <%= CPCURRENT() %><br>
Cedilha up <%= ASC('Ç') %><br>
Cedilha low <%= ASC('ç') %><br>

Everthing is solved with the inclusion off the head tag,

Feb 6, 2012 at 6:56 PM

Please note that this is usefull for "call in chars " or in other words characters that is sent from page to FOXpro eval funciom, regarding output chars, still need to handle inside activeVFP a better html encoder that includes those chars, ( i'm working on it )