Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Delphi For PHP > VCL4PHP
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

VCL4PHP VCL for PHP. Questions or comments about the Visual Component Library for PHP, post them here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 1st February 2010, 13:18
D4PHP User
 
Join Date: Sep 2009
Posts: 16
mariusz is on a distinguished road
Default Character set problem

Hi!

I'm programing for Poland. I have mysql (5.0.33) database (latin2_general_ci).
Main data encoding for this region is ISO-8859-2.
Data in database are already set (I'm responding for presentation and append)

In my project I have
Database->Charset = latin2
Unit->Encoding = Central European (ISO) |iso-8859-2
I have also some labels with texts with some national characters: ążśźęćŁĄŻŚĆĘŃ

In effect, I have:
DBGrid with correctly presented national characters, but every controls edited in design time are NOT presented correctly (I see bush except national characters).

Change Unit->Encoding to UTF8 does not bring expected results (I have labels presented correctly, but data in a dbgrid NOT).
Situation 1
Unit1->Encoding = Central European (ISO) |iso-8859-2
Database1->Charset = latin2
File Encoding = ANSI
Character set = Central Europe

Situation 2
Unit1->Encoding = Unicode (UTF-8) |utf-8
Database1->Charset = utf8
File Encoding = UTF-8
Character set = Central Europe


It seems to me, like every time, design time edited controls has texts saved in UTF8 even a xml.php file has ANSI encoding.

My question is:
How should I configure my IDE (and several files) to take expected effects? (for example - everything encoded in latin2)



regards
M

Last edited by mariusz; 1st February 2010 at 13:39.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11th February 2010, 21:50
D4PHP User
 
Join Date: Jul 2009
Posts: 23
vicmazurca is on a distinguished road
Default

I use language portuguese and I have this problem too.

I convert my Database to utf-8, document type to utf-8 and tamplate file to utf-8 and resolve problem in major cases (qx).

I make this function and I use to set text from database in labels and combos.

function RetornaUTF8($string)
{
$encoding = "UTF-8";
if ((mb_detect_encoding($string.'x', 'UTF-8, ISO-8859-1')) != $encoding)
{
$string = utf8_encode($string);
}
return($string);
}

You can adapt it to your case.

I hope help you, but I stay yet being spanced by d4php auhauhuhahuahua.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12th February 2010, 07:48
D4PHP User
 
Join Date: Sep 2009
Posts: 16
mariusz is on a distinguished road
Default

I have resolved my problem in the case when I'm using UTF. After Database connect I'm calling sql 'set names utf8'. It helps.
I still can not resolve problem with ISO-8859-1 encoding.
See my thread BUG - Characters encoding

vicmazurca
Thank you for your tips. As you, I have resolved this other way, but I appreciate your try.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 06:01.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use