Character Set

Is it possible to use

charset=iso-8859-7

instead utf-8 ?

and how we can do that ?

Thanks alot people :slight_smile:

Yep, in case of loading from xml data just start it with

<?xml version="1.0" encoding="iso-8859-7" ?> ... data here ...

In case of connectors - it can be achieved with

$conn->set_encoding("iso-8859-7");

I have tried that but still I can not get it right.

I am using the units examble

with var dp = new dataProcessor(“php/types.php”);

where should I declare the

$con->set_encoding(“iso-8859-7”);

<?php include ('../connector/scheduler_connector.php'); include ('../common/config.php'); $res=mysql_connect($server, $user, $pass); mysql_select_db($db_name); $list = new OptionsConnector($res); $list->render_sql("select typeid as value, name as label from iatroi UNION select typeid as value, name as label from psixologoi","typeid","typeid(value),name(label)"); $scheduler = new schedulerConnector($res); //$scheduler->enable_log("log.txt",true); $scheduler->set_options("type", $list); $scheduler->render_table("tevents","event_id","start_date,end_date,event_name,type"); ?>

thank you in advance

Before render table

$scheduler->set_encoding("iso-8859-7"); $scheduler->render_table("tevents","event_id","start_date,end_date,event_name,type");

Before I asked the question I did try that and produces the following error :

Error type: LoadXML
Description : Incorrect XML

Thank you for your help in advanced

Try to load xml feed directly in browser - it will show more detailed error info.
Most probably your data has different encoding

Thank you for the prompt responce

the direct feed is

<?xml version="1.0" encoding="iso-8859-7" ?>
  • <coll_options for=“type”>




    </coll_options>

Collation for the specific fields is set greek_general_ci

Try to load xml feed directly in browser
When you are loading data in the browser is it renders as XML or show some error info ?

By any chance, is any label contains such chars as <>& ?

I manage to get the XML output right… but I can not save the data correctly (in greek in the database) neither to get the labels for the units right. They come up as squares. No the creazy thing is that the values in the lightbox list are displayed correct in greek.

<?xml version="1.0" encoding="iso-8859-7" ?>
  • <coll_options for=“type”>





    </coll_options>

which is correct

the way to get correctly the xml is as follows

<?php include ('../connector/scheduler_connector.php'); include ('../common/config.php'); $res=mysql_connect($server, $user, $pass); mysql_select_db($db_name); mysql_query('set character set greek',$res); mysql_query("SET NAMES 'greek'",$res); $list = new OptionsConnector($res); $list->set_encoding("greek"); $list->render_sql("select typeid as value, name as label from iatroi UNION select typeid as value, name as label from psixologoi","typeid","typeid(value),name(label)"); $scheduler = new schedulerConnector($res); //$scheduler->enable_log("log.txt",true); $scheduler->set_options("type", $list); $scheduler->set_encoding("greek"); $scheduler->render_table("tevents","event_id","start_date,end_date,event_name,type"); ?>

when I entere en event even though the lightbox list is correct this is the result

<?xml version="1.0" encoding="iso-8859-7" ?>
  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>

-

  • <coll_options for=“type”>





    </coll_options>

for some reason the data when saved are not in the right greek format.

any ideas ?

Fixed the problem on displaying the Units headers correcly.

Still the data saved are not in the proper form.

Any Ideas ?

I have narrowed down the problem. It is while saving. For some reason it seams it is changing the encoding to I do not know what.

If I save the value directly into the databse table it works fine.
0
If I enter a value in thelightbox initially (while not refreshing) it is displayed correctly. But If I check the data in the mysql table it is a mess and offcourse if I reload theplanner the data are not readable.

is there a way to see the data that is send to the table ? or is this some sohort of a problem with the js file ? (it seams like a problem of the js)

Try to add the next command to the client side code

dp.enableUTFencoding(false);

By default, dataprocessor escapes data and sends it to server as UTF-8
With above code, data will be sent without encoding - which may help in your case.

I did try that before as well

without dp.enableUTFencoding(false);

<?xml version="1.0" encoding="greek" ?>
  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>

-

  • <coll_options for=“type”>





    </coll_options>

with dp.enableUTFencoding(false);

<?xml version="1.0" encoding="greek" ?>
  • <start_date>
  • </start_date>
  • <end_date>
  • </end_date>

-

  • <coll_options for=“type”>





    </coll_options>

no good :frowning:

While you are loading data as “greek”, which encoding you are using for HTML page on which scheduler resides ?

charset=iso-8859-7

and that is why units headers are displayed correctly

If you are not using utf-escaping, data will be sent to the server side as is.
On server side, connector will not do any updates of data, except of using mysql_real_escape_string - which uses DB collation, so must not affect data as well.

During reading data from DB - there is no conversion as well.

The code snippet , with “set names” - it is used in the script , which you are using for data saving , right ?

it is used as follows

<?php include ('../connector/scheduler_connector.php'); include ('../common/config.php'); $res=mysql_connect($server, $user, $pass); mysql_select_db($db_name); [b] mysql_query('set character set greek',$res); mysql_query("SET NAMES 'greek'",$res); [/b] $list = new OptionsConnector($res); [b] $list->set_encoding("greek");[/b] $list->render_sql("select typeid as value, name as label from iatroi UNION select typeid as value, name as label from psixologoi","typeid","typeid(value),name(label)"); $scheduler = new schedulerConnector($res); //$scheduler->enable_log("log.txt",true); $scheduler->set_options("type", $list); [b] $scheduler->set_encoding("greek");[/b] $scheduler->render_table("tevents","event_id","start_date,end_date,event_name,type"); ?>

Using that I am getting correct xml results as I showed you and everything works fine with in lightbox.

Try to uncomment
$scheduler->enable_log(“log.txt”,true);
and check values which are going to client side during data saving - are they are correctly encoded , or already broken ?

If they are correct - the conversion occurs somewhere in DB.

when using dp.enableUTFencoding(false);

====================================
Log started, 16/08/2010 03:08:03

DataProcessor object initialized
1281970383094_start_date => 2010-08-17 08:45
1281970383094_end_date => 2010-08-17 11:10
1281970383094_text => %u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE
1281970383094_id => 1281970383094
1281970383094_type => 1
1281970383094_!nativeeditor_status => inserted
ids => 1281970383094

Row data [1281970383094]
start_date => 2010-08-17 08:45
end_date => 2010-08-17 11:10
event_name => %u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE
event_id => 1281970383094
type => 1
!nativeeditor_status => inserted

INSERT INTO tevents(start_date,end_date,event_name,type) VALUES (‘2010-08-17 08:45’,‘2010-08-17 11:10’,’%u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE’,‘1’)

Edit operation finished
0 => action:inserted; sid:1281970383094; tid:1;

Done in 0.0112159252167s

====================================
Log started, 16/08/2010 03:08:06

DataProcessor object initialized
1281970383098_start_date => 2010-08-16 08:55
1281970383098_end_date => 2010-08-16 12:40
1281970383098_text => %u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE
1281970383098_id => 1281970383098
1281970383098_type => 12
1281970383098_!nativeeditor_status => inserted
ids => 1281970383098

Row data [1281970383098]
start_date => 2010-08-16 08:55
end_date => 2010-08-16 12:40
event_name => %u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE
event_id => 1281970383098
type => 12
!nativeeditor_status => inserted

INSERT INTO tevents(start_date,end_date,event_name,type) VALUES (‘2010-08-16 08:55’,‘2010-08-16 12:40’,’%u039D%u03AD%u03B1 %u03B5%u03B3%u03B3%u03C1%u03B1%u03C6%u03AE’,‘12’)

Edit operation finished
0 => action:inserted; sid:1281970383098; tid:2;

Done in 0.0152730941772s

when not using dp.enableUTFencoding(false);

====================================
Log started, 16/08/2010 03:08:46

DataProcessor object initialized
1281970608454_start_date => 2010-08-17 08:50
1281970608454_end_date => 2010-08-17 12:05
1281970608454_text => Νέα εγγραφή
1281970608454_id => 1281970608454
1281970608454_type => 1
1281970608454_!nativeeditor_status => inserted
ids => 1281970608454

Row data [1281970608454]
start_date => 2010-08-17 08:50
end_date => 2010-08-17 12:05
event_name => Νέα εγγραφή
event_id => 1281970608454
type => 1
!nativeeditor_status => inserted

INSERT INTO tevents(start_date,end_date,event_name,type) VALUES (‘2010-08-17 08:50’,‘2010-08-17 12:05’,‘Νέα εγγραφή’,‘1’)

Edit operation finished
0 => action:inserted; sid:1281970608454; tid:1;

Done in 0.0109269618988s

====================================
Log started, 16/08/2010 03:08:48

DataProcessor object initialized
1281970608458_start_date => 2010-08-18 10:10
1281970608458_end_date => 2010-08-18 12:45
1281970608458_text => Νέα εγγραφή
1281970608458_id => 1281970608458
1281970608458_type => 1
1281970608458_!nativeeditor_status => inserted
ids => 1281970608458

Row data [1281970608458]
start_date => 2010-08-18 10:10
end_date => 2010-08-18 12:45
event_name => Νέα εγγραφή
event_id => 1281970608458
type => 1
!nativeeditor_status => inserted

INSERT INTO tevents(start_date,end_date,event_name,type) VALUES (‘2010-08-18 10:10’,‘2010-08-18 12:45’,‘Νέα εγγραφή’,‘1’)

Edit operation finished
0 => action:inserted; sid:1281970608458; tid:2;

Done in 0.010871887207s

the log seams ok but the data are getting altered again in the table