Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By azatrath
#813186
hi all,

i have a problem about trigger which select datas from mssql.
Code: Select all
$AA01 = @@AA01; 
$db = "4546508785a77f4fd886ea4091331478";
$query = ("select A.cus_desc AS CUSTOMER,A.sp_orderno,qty_desc AS KALITE,rnk_palet,rnk_desc,edge_kodu,A.sp_note1,A.sp_note2 as note2,A.sp_note3 as note3,A.sp_note4,A.sp_note5,A.sp_note6
,ns_desc,ts_desc,a.sp_ordate,a.sp_odeme,a.sp_sonyukleme,
(select obt_values from cw_000_orderbilgi where obt_orderref=a.sp_referans and obt_bilkodu=10) AS LANSET
from cwv_000_orderlist AS A
left outer join cwv_000_orderfis as B on (B.sp_referans=ss_orderref)
where A.sp_orderno='$AA01' group by A.sp_orderno,A.cus_desc,qty_desc,rnk_palet,rnk_desc,edge_kodu,A.sp_note1,A.sp_note2,A.sp_note3,A.sp_note4,A.sp_note5,A.sp_note6,ns_desc,ts_desc,a.sp_ordate,a.sp_odeme,a.sp_sonyukleme,A.sp_referans
");
$result = executeQuery($query,$db);
$CUSTOMER = $result['1']['CUSTOMER'];
$KALITE = $result['1']['KALITE'];
$note3 =  $result['1']['note3'];
$note2 = $result['1']['note2'];
@@BB01 = "Müsteri: $CUSTOMER \nKalite : $KALITE \nNote : $note3 \n$note2";

PMFRedirectToStep(@@APPLICATION, @%INDEX, 'DYNAFORM', '8620300295a6f0ed93e80c9025529768');
thats my trigger. its not completed yet.

the problem is turkish character. sp.notes sometimes include "ş,ç,ğ". there is 2 image i am showing you will understand the problem.
Adsız.png
Adsız.png (44.84 KiB) Viewed 4482 times
is working well because there is no turkish character.
Adsız1.png
Adsız1.png (15.8 KiB) Viewed 4482 times
Adsız3.png
Adsız3.png (29.46 KiB) Viewed 4482 times
when i click its clear all area start like new. the note have this sentence"MÜŞTERİ BİLGİLERİ KULLANILACAK"
i searched web and forum. there is some solution for MYSQL but no solution for MSSQL
User avatar
By amosbatto
#813195
Are you using freetds in Linux? If so, then you need to add this line to your freetds.conf file:
Code: Select all
tds version = 7.0
client charset = UTF-8
See: http://wiki.processmaker.com/3.0/Databa ... nux.2FUNIX
Note: If you are using a recent version of PM, then you don't have to edit the MSSQLResultSet.php file as explained in the next section, because the code to convert the character set has already been commented out.

If PM is installed in Windows, then try adding this line to the beginning of your trigger:
Code: Select all
ini_set('mssql.charset', 'UTF-8');
By azatrath
#813214
amosbatto wrote:Are you using freetds in Linux? If so, then you need to add this line to your freetds.conf file:
Code: Select all
client charset = UTF-8
See: http://wiki.processmaker.com/3.0/Databa ... nux.2FUNIX
Note: If you are using a recent version of PM, then you don't have to edit the MSSQLResultSet.php file as explained in the next section, because the code to convert the character set has already been commented out.

If PM is installed in Windows, then try adding this line to the beginning of your trigger:
Code: Select all
ini_set('mssql.charset', 'UTF-8');
i am using windows server 2012 and the code you gave me didnt change anything. btw there is no error message with that. i dont know why my other variable getting clear.
User avatar
By amosbatto
#813228
What character set is MSSQL using? Use this query in MSSQL to find out:
Code: Select all
Select TABLE_NAME, COLUMN_NAME, Columns.COLLATION_NAME From INFORMATION_SCHEMA.COLUMNS;
If it is UNICODE, then using UCS-2. If it is iso_1, then using ISO 8859-1. Probably you are using the Turkish character set iso_9, which is ISO-8859-9.
See:
https://stackoverflow.com/questions/732 ... e-database

If you know the character set, then you can add trigger code that uses mb_convert_encoding() to convert to UTF-8:
Code: Select all
$CUSTOMER = mb_convert_encoding($result['1']['CUSTOMER'], 'UTF-8', 'ISO-8859-9');
$KALITE = mb_convert_encoding($result['1']['KALITE'], 'UTF-8', 'ISO-8859-9');
$note3 =  mb_convert_encoding($result['1']['note3'], 'UTF-8', 'ISO-8859-9');
$note2 = mb_convert_encoding($result['1']['note2'], 'UTF-8', 'ISO-8859-9'); 
By azatrath
#813240
amosbatto wrote:What character set is MSSQL using? Use this query in MSSQL to find out:
Code: Select all
Select TABLE_NAME, COLUMN_NAME, Columns.COLLATION_NAME From INFORMATION_SCHEMA.COLUMNS;
If it is UNICODE, then using UCS-2. If it is iso_1, then using ISO 8859-1. Probably you are using the Turkish character set iso_9, which is ISO-8859-9.
See:
https://stackoverflow.com/questions/732 ... e-database

If you know the character set, then you can add trigger code that uses mb_convert_encoding() to convert to UTF-8:
Code: Select all
$CUSTOMER = mb_convert_encoding($result['1']['CUSTOMER'], 'UTF-8', 'ISO-8859-9');
$KALITE = mb_convert_encoding($result['1']['KALITE'], 'UTF-8', 'ISO-8859-9');
$note3 =  mb_convert_encoding($result['1']['note3'], 'UTF-8', 'ISO-8859-9');
$note2 = mb_convert_encoding($result['1']['note2'], 'UTF-8', 'ISO-8859-9');
you are awesome amos ! i am appreciated :)

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]