اللغة العربية مع قواعد البيانات فايربيرد ودلفي 2006 باستخدام مكوناتZeosDBO
#1
السلام عليكم ورحمة الله

في برنامجي بدلفي 2006 استعمل فير بيرد ومحرك Zeosdbo
لكن العربية لا تظهر ؟! جرت في نفس المشروع محرك absolutedatabase تظهر العربية عادي جربت zeosdbo على لازراس تتظهر العربية عادي على دلفي 2010 عادي يعني ان المشكلة في دلفي 2006
لا اعلم كيف يصبح يدعم العربية مع zeosdbo
جربت codepage=UTF8 ولم تنجح
هل من له خبرة في كيفية حل هته المشكلة التي جننتني
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد
#2
السلام عليكم
ألا يوجد من جربه على دلفي 2006؟
ام هو صعب فابتعدعنه؟
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد
#3
نجحت معى هذه الطريقة لكنها مرهقة

لادخال البينات نستعمل الاجراات المخزنة بواسطة المكون ZStoredProc
كود :
with ZStoredProc1 do begin Params[0].AsString := [color=Red]UTF8Encode[/color]('دالفى '); Params[1].AsString := [color=Red]UTF8Encode[/color]('للعرب'); ExecProc; end;

لعرض البيانات فى الحدث OnGetText للحقل نكتب
كود :
var s: string; begin s := WideCharToString(PWideChar([color=Red]UTF8Decode[/color](Sender.AsString))); Text := S ;

اقترح عليك استعمال مكونات اخرى : dbExpress .. درايفر مجانى هنـــــــــــــــا
الرد
#4
السلام عليكم ورحمة الله
بارك الله فيك اخي hanipino
تبدو حقا شاقة لي عودة ان شاء الله بعد التجربة
لكن هل تعلم غير dbExpress مجانية لان dbexpress غير مجانية في الدلفي وانا اعمل بدلفي 2006 غير متوفرة فيه كما اني وجدت مكون dbexpress وحده قابل للتثبيت مع دلفي ولم ارغب في استعماله لانني اظن انه غير مجاني
ان كنت تعلم غيره اعلمنا بارك الله فيك
للعلم استعملت UIB2.5 لكن نفس مشكلة اللغة
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد
#5
كنت اعتقد ان مكونات dbExpress موجودة فى Turbo Delphi Explorer ... للاســــــــــــــــــــــــف
--------------
ساحاول مع UIB
الرد
#6
بارك الله فيك اخي hanipino
جزاك الله خيرا
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد
#7
[INDENT]
السلام عليكم ورحمة الله وبركاته ،
وبالنسبة للمكونات UIB أخي Mobile هل جربتها ؟

رابط التحميل :
كود :
http://www.progdigy.com/
[/INDENT]
اللهم اجعلني من أهل القرآن ، الذين هم أهلك و خاصتك.
تذكر بأن الوقت الذي تلهو فيه ، غيرك يبني مجده فيه.
الرد
#8
وعليكم السلام ورحمة الله
نعم جربتها نفس مشكلة اللغة
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد
#9
[INDENT]
طيب هل جربت استعمال مكونات TntUnicode تجدها هنا :

http://www.delphi4arab.net/forum/showthr...p?tid=2000
[/INDENT]
اللهم اجعلني من أهل القرآن ، الذين هم أهلك و خاصتك.
تذكر بأن الوقت الذي تلهو فيه ، غيرك يبني مجده فيه.
الرد
#10
[indent]
وأيضا وجدت هذا الموضوع :

إقتباس : delphi + zeoslib + mysql + utf8 howto

after fiddling around with all these components i finally made a working database connection with my server. It appears to me, that all connections made to mysql 4.1 default to the "latin1" encoding no matter what the database contains. To work with utf8 you have to tell zeos to set up certain server variables. You can do this by executing the sql command: "set character_set_connection=utf8; set character_set_results=utf8;" starting that moment, mysql expects to get all commands in utf8 and will also return all datasets in utf8! You can put these variables into your tzconnection.properties string list:



Character_set_connection=utf8
character_set_results=utf8

hint: If you want mysql to use 100% utf8 internally, just add the following to your tzconnection.properties:



Character_set_client=utf8
character_set_connection=utf8
character_set_database=utf8
character_set_results=utf8
character_set_server=utf8
character_set_system=utf8
collation_connection=utf8_general_ci
collation_database=utf8_general_ci
collation_server=utf8_general_ci
codepage=utf8

now that mysql is returning everything in utf8 you have to make sure to use widestring variables always.

For non-blob fields you can use the following:



Var mystring : Widestring;
var dbstring : Utf8string;
[...]
dbstring := mytable.fieldbyname('title').asstring;
mystring := utf8decode(dbstring);

blobs are returned as a stream, this also applies to text fields however since you have stored them in utf8 (using utf8encode()) you still need to decode them with utf8decode(). I'm using the (shareware) diunicode tool for utf8 stream manipulation but that's eur 20.- although it comes with a nifty library of widestring utility functions like strreplaceiw() if you don't want to spend money you can download the libiconv conversion for free and write a stream conversion tool yourself.

Now that you're working with widechars which are unicode two byte encoded you have to stay the f.... Away from all and any library function that doesn't end in a "w". Most notably you will not be able to read resourcestrings from your pascal code. Loadstring() is using ansistring internally which automatically converts widestring to cp windows 1252 and back to widestring to fit your variable (or whatever your system default codepage is). That doesn't create much of a problem unless you're using characters which are definitely not in your cp - which is the very reason for using utf8 and unicode in the first place.

If you haven't been playing with unicode before you will trip over another problem: The vcl is written using ansistring's. Which means, all controls is converting widestring's to ansistring's when you write something like: mycontrol.caption := coolcyrillicwidestring; it will create a caption like: ???? ?? ??. 24??? ??????

fortunately there is a vcl library available which deals with the problem: Tnt controls. You have to use these controls whenever you want to have a control i18n aware.

Another reason for using unicode is speed. Windows nt, 2000, xp, and vista is using unicode internally. All ansistring functions are just wrapper functions around the corresponding unicode functions. Omitting these wrapper functions can speed up your application notably when used properly.

Now that your data is on your server you should make sure to always put mysql in utf8 mode especially when using php to access your data which is common work in web based cms or crm systems. Always use the following:

$res = mysql_query('show variables like "character_set_results"');
if ($row = mysql_fetch_row($res) {
$oldcharset = $row[1];
} else {
$oldcharset = 'latin1';
}
mysql_query("set character_set_results = 'utf8'");

[...insert your code here...]

mysql_query("set character_set_results = '".$oldcharset."');
?>

if your php code is not embedded into a forum or cms/crm system you can of course omit querying the original encoding. The code above will allow you to receive your database content in utf8 but it will not allow you to query data using utf8! You have to set character_set_connection to utf8 as well but since php doesn't properly support utf8 i prefer to work around that problem using a uid auto_increment value for row selection.
[/indent]
اللهم اجعلني من أهل القرآن ، الذين هم أهلك و خاصتك.
تذكر بأن الوقت الذي تلهو فيه ، غيرك يبني مجده فيه.
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 2 ) ضيف كريم