NetTalk Central

Author Topic: Character Sets  (Read 11201 times)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Character Sets
« on: May 06, 2010, 08:00:41 AM »
NetTalk Version 5, PR16 or later applies.

update - PR20 adds support for Spanish

Introduction

Many countries use more than the basic ASCII Roman character set. Handling data with extended character sets can be tricky. There are two basic ways your data may be stored. Please read this section and then decide which way needs to be handled in your situation.

Web HTML Charset

Set the HTML Charset on the Advanced tab of the WebServer procedure settings. The following information ONLY applies if you have the HTML Charset set to 'utf-8'.
Regardless of the way your data is stored, I recommend setting the charset to utf-8.

Utf-8 is an encoding scheme for encoding unicode characters. The reasons for choosing utf-8 is outside the scope of this article.

Data Stored as utf-8

If your app is exclusively a web app, and data will be entered via a browser, and displayed via a browser, then the data can be stored in the database in utf-8 format. If you are using a SQL engine it's also possible that other (non Clarion) apps, that support utf-8, will be happy with this approach.

This is the default approach for NetTalk, if the charset is set to utf-8.

Data Stored as a "code page"

If your data has been captured by a Clarion program, or will be displayed by a clarion program (INCLUDING a Clarion Report) then the data must be converted to a specific code page for storage, and converted back to utf-8 when being displayed in a web page. This makes the data limited to one specific code-page - however in most cases that is ok, since your Clarion app was limited in that way anyway.

Support for each language has to be added on a case-by-case basis. So far support has been added for;
Polish (PR16), Spanish (PR20)

If you use an extended characters that aren't in the list of languages above, then please contact me. I may need some minor information from you, but it should be straight-forward to add support for other languages.

At this stage you will need to set a setting, in embed code, in the web server procedure. (ie it isn't yet a template option.) In the web server procedure, in the "Override Default Server Settings" "NetTalk Object After s_web assigned" embed point, add a line of code something like this;

s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsPolish
or
s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsSpanish

As more languages are added, more equates will be available as well. It's also possible that regions will be introduced which span multiple countries that share characters.

« Last Edit: June 13, 2010, 11:01:34 PM by Bruce »

rainerwallenius

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Email
Re: Character Sets
« Reply #1 on: June 16, 2010, 03:59:34 AM »
This charset-issue is really getting to me. I am obviously doing something very wrong here.

I updated today to PR 19 and things got even worse.

I have problems presenting scandinavian characters (and all other european characters) in prompts as well as input fields. Field validation erases seemingly randomly characters including å, ä, ö (umlauts) etc.
I tried using polish or spanish language setting as Bruce wrote in another message - no help.
And the webserver even "translates" double quotes and brackets to html-code (for example: < to /&lt;) ruining ímgae displaying.
So the problem is both data displayed AND data from database (topspeed).
Any help is highly appreciated.
TIA, rainer

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Character Sets
« Reply #2 on: June 16, 2010, 04:07:59 AM »
Is PR20 up?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Character Sets
« Reply #3 on: June 16, 2010, 07:56:58 AM »
not yet - probably tomorrow.

rainerwallenius

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Email
Re: Character Sets
« Reply #4 on: June 29, 2010, 03:21:28 AM »
Just updated to PR23 and my scandinavian characters are back - great!

I had to disable dictionary validation though in forms. This is no issue since I have no use for this anyway.
Bruce, if you are going to add translation table for scandinavian charsets, I would like help - if possible...

thanks,

rainer