Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#815841
Hi
I install process maker 3.2.3 with php 5.6 on windows 64bit
I download https://wiki.processmaker.com/sites/def ... libx64.dll and add to ext php...
I can connect to sql server 2008 but when write query for drop down control return ??? text for utf-8 data...
I write this sample code that you can test...
Code: Select all

ini_set('mssql.charset', 'UTF-8');

$myServer = "192.168.250.42";
$myUser = "khoob";
$myPass = "123456";
$myDB = "test";

MSSQL_CONNECT($myServer,$myUser,$myPass) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($myDB) or DIE("Database unavailable");
  
  $query = "SELECT * FROM dbo.zahra";

$result = mssql_query( $query );

for ($i = 0; $i < mssql_num_rows( $result ); ++$i)
     {
         $line = mssql_fetch_row($result);
         print( "$line[0] - $line[1]\n");
     }
my table
1.JPG
1.JPG (2.35 KiB) Viewed 8483 times
returned data
2.JPG
2.JPG (8.81 KiB) Viewed 8483 times
please help me
#815843
Are you sure that your web browser is set to UTF-8? ProcessMaker is always set to UTF-8, but your custom web page probably isn't. Add this to the top of your code to set the character set:
Code: Select all
echo "<html>\n<head>\n<meta charset="utf-8"/>\n</head>\n<body>\n";
If you are using freetds, then ini_set('mssql.charset', 'UTF-8') isn't necessary. Instead, set these lines in your /etc/freetds/freetds.conf file:
Code: Select all
tds version = 8.0
client charset = UTF-8
If that doesn't work, then try: tds version = 7.0
#815869
SQL Server 2008 didn t support UTF-8, although you can convert to UTF-8 with FreeTDS in Linux. I don t know how to convert the connection to UTF-8 in Windows.

First, find out which character set SQL Server is using with this query inside SQL Server:
SELECT zahra, COLUMN_NAME, Columns.COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS
(replace COLUMN_NAME with the name of the column in the zahra table)

Once you know the character set, then you can convert it like this:
Code: Select all
for ($i = 0; $i < mssql_num_rows( $result ); ++$i)     {
         $line = mssql_fetch_row($result);
         $part1 = mb_convert_encoding(line[0], "UTF-8", "UCS-2"); //if using UCS-2
         $part2 = mb_convert_encoding(line[1], "UTF-8", "auto"); //maybe it can auto-detect the character set
         print( "$part1 - $part2\n");
     }
#815874
Thanks Amos
collation data base and zahra table is Arabic_ci_as.
when i check encoding text with
Code: Select all
strtoupper(mb_detect_encoding($sValue))
This return ASCII ...
so
Code: Select all
         $part1 = mb_convert_encoding(line[0], "UTF-8", "UCS-2"); //if using UCS-2
         $part2 = mb_convert_encoding(line[1], "UTF-8", "auto"); //maybe it can auto-detect the character set
Not worked...
https://wiki.processmaker.com/sites/def ... libx64.dll is official dll to unofficial?
#815875
ashkufaraz wrote: Fri Aug 31, 2018 1:40 am Thanks Amos
collation data base and zahra table is Arabic_ci_as.
when i check encoding text with
Code: Select all
strtoupper(mb_detect_encoding($sValue))
return ASCII ...
so
Code: Select all
         $part1 = mb_convert_encoding(line[0], "UTF-8", "UCS-2"); //if using UCS-2
         $part2 = mb_convert_encoding(line[1], "UTF-8", "auto"); //maybe it can auto-detect the character set
Not worked...
https://wiki.processmaker.com/sites/def ... libx64.dll is official dll to unofficial?

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[…]