 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
sham Guest
|
Posted: Wed Jun 14, 2006 9:55 pm Post subject: Unicode for BOLD |
|
|
Hi to all,
I have pasted some greek characters into a bold application and they appear
fine. When I save my bold object and then access it again, in the component
there appears to be some unicode to AscII conversion.
Can bold support UNICODE? If not how can I change my program to support
unicode?
Sham. |
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Wed Jun 14, 2006 11:16 pm Post subject: Re: Unicode for BOLD |
|
|
There is the WideString attribute, look in the \Samples\Unicode\ I haven't
actually used it so can't tell you more.
Regards,
Danny |
|
| Back to top |
|
 |
sham Guest
|
Posted: Thu Jun 15, 2006 5:56 pm Post subject: Re: Unicode for BOLD |
|
|
Thanks Daniel,
We maybe moving to Delphi 2006, so the question arises whether this would
resolve the problem?
Has anyone got any ideas on how to use the unicode units in the samples
directory?
Sham.
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:4490525b (AT) newsgroups (DOT) borland.com...
| Quote: | There is the WideString attribute, look in the \Samples\Unicode\ I
haven't
actually used it so can't tell you more.
Regards,
Danny
|
|
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Thu Jun 15, 2006 8:25 pm Post subject: Re: Unicode for BOLD |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote:
| Quote: | We maybe moving to Delphi 2006, so the question arises whether this would
resolve the problem?
|
If you plan on using Bold in D2006 it should be the same, as there are no
unicode related changes in D2006 compared to D7 in the Win32 personality.
| Quote: | Has anyone got any ideas on how to use the unicode units in the samples
directory?
|
I think you need to make a new package and add those units, then install in
IDE, and WideString attribute should be available at design time.
Regards,
Danny |
|
| Back to top |
|
 |
sham Guest
|
Posted: Fri Jun 16, 2006 2:57 pm Post subject: Re: Unicode for BOLD |
|
|
Hi Danny,
I tried putting the units in a package but received an error saying
boldatttributestring.pas was part of boldd70util.dpl.
In the model editor there is no widestring attribute.
Any ideas?
Sham.
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:44917bbb (AT) newsgroups (DOT) borland.com...
| Quote: | "sham" <shamresh (AT) inspirationmatters (DOT) com> wrote:
We maybe moving to Delphi 2006, so the question arises whether this would
resolve the problem?
If you plan on using Bold in D2006 it should be the same, as there are no
unicode related changes in D2006 compared to D7 in the Win32 personality.
Has anyone got any ideas on how to use the unicode units in the samples
directory?
I think you need to make a new package and add those units, then install
in
IDE, and WideString attribute should be available at design time.
Regards,
Danny
|
|
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Fri Jun 16, 2006 3:19 pm Post subject: Re: Unicode for BOLD |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
| Quote: | Hi Danny,
I tried putting the units in a package but received an error saying
boldatttributestring.pas was part of boldd70util.dpl.
In the model editor there is no widestring attribute.
Any ideas?
|
Hi Sham,
Yes, there are instructions in unit BoldAttributeWideString, you have to add
it manually as you would for the custom attribute types:
// To install this attribute type in your application, add the following to
your
// TypeNameHandle:
//
// ModelName: UniCode
// ExpressionName: WideString
// DelphiName: TBAWideString
// ContentName: WideString
// PMapper: TBoldPMWideString
// Accessor: AsWideString
// NativeType: WideString
// UnitName: BoldAttributeWideString
Regards,
Danny |
|
| Back to top |
|
 |
sham Guest
|
Posted: Fri Jun 16, 2006 4:38 pm Post subject: Re: Unicode for BOLD |
|
|
Thanks for the instructions, I could not find any instructions in
BoldAttributeWideString.pas.
I have done as you said (adding type to typeHandle), and I see wideString as
an attribute in the model editor. I have now set one of my class properties
to WideString and generated the code. However, the interface unit for my
project still contains has my property as TBAString (I was expecting
TBAWideString).
Am I missing a step?
Sham
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:4492858c (AT) newsgroups (DOT) borland.com...
| Quote: |
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
Hi Danny,
I tried putting the units in a package but received an error saying
boldatttributestring.pas was part of boldd70util.dpl.
In the model editor there is no widestring attribute.
Any ideas?
Hi Sham,
Yes, there are instructions in unit BoldAttributeWideString, you have to
add
it manually as you would for the custom attribute types:
// To install this attribute type in your application, add the following
to
your
// TypeNameHandle:
//
// ModelName: UniCode
// ExpressionName: WideString
// DelphiName: TBAWideString
// ContentName: WideString
// PMapper: TBoldPMWideString
// Accessor: AsWideString
// NativeType: WideString
// UnitName: BoldAttributeWideString
Regards,
Danny
|
|
|
| Back to top |
|
 |
sham Guest
|
Posted: Fri Jun 16, 2006 5:10 pm Post subject: Re: Unicode for BOLD |
|
|
Hi,
Instead of having the // ModelName: UniCode, I replaced UniCode with
WideString and the interface unit is showing TBAWideString.
I have evolved the database and the string column has been dropped and a new
column has been created with character set ISO 8859.
When running the app, I am still seeing the data entered (in Greek) as weird
character when retrieved from the database.
Do I need to change the tboldEdit components?
Sham
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:44929813$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Thanks for the instructions, I could not find any instructions in
BoldAttributeWideString.pas.
I have done as you said (adding type to typeHandle), and I see wideString
as an attribute in the model editor. I have now set one of my class
properties to WideString and generated the code. However, the interface
unit for my project still contains has my property as TBAString (I was
expecting TBAWideString).
Am I missing a step?
Sham
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:4492858c (AT) newsgroups (DOT) borland.com...
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
Hi Danny,
I tried putting the units in a package but received an error saying
boldatttributestring.pas was part of boldd70util.dpl.
In the model editor there is no widestring attribute.
Any ideas?
Hi Sham,
Yes, there are instructions in unit BoldAttributeWideString, you have to
add
it manually as you would for the custom attribute types:
// To install this attribute type in your application, add the following
to
your
// TypeNameHandle:
//
// ModelName: UniCode
// ExpressionName: WideString
// DelphiName: TBAWideString
// ContentName: WideString
// PMapper: TBoldPMWideString
// Accessor: AsWideString
// NativeType: WideString
// UnitName: BoldAttributeWideString
Regards,
Danny
|
|
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Fri Jun 16, 2006 5:15 pm Post subject: Re: Unicode for BOLD |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
| Quote: | Am I missing a step?
|
hmm, I just tried it here and the codegen did generate the following :
TNewClass = class(TBusinessClassesRoot)
private
function _Get_M_NewAttribute: TBAWideString;
function _GetNewAttribute: WideString;
procedure _SetNewAttribute(const NewValue: WideString);
protected
public
property M_NewAttribute: TBAWideString read _Get_M_NewAttribute;
property NewAttribute: WideString read _GetNewAttribute write
_SetNewAttribute;
end;
So, don't know what could be the problem you're having, try to create a test
app and repeat all steps again, I guess.
Regards,
Danny |
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Fri Jun 16, 2006 5:47 pm Post subject: Re: Unicode for BOLD |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
| Quote: | When running the app, I am still seeing the data entered (in Greek) as
weird
character when retrieved from the database.
Do I need to change the tboldEdit components?
|
I suspect you are correct and it's the controls that don't really support
unicode, try to test with TNT controls
http://www.tntware.com/delphicontrols/unicode
Unforunately, these are not Bold aware, but try to fill them manually to see
if that will work.
Regards,
Danny |
|
| Back to top |
|
 |
sham Guest
|
Posted: Mon Jun 19, 2006 3:26 pm Post subject: Re: Unicode for BOLD |
|
|
Hi Danny,
I have replaced the TBoldEdit component with a TNTEdit component and at the
object space level, the unicode strings seem correct (i.e. assigning unicode
string to object property from a TNTEdit component and then showing it in
another TNTEdit component).
What I found by using by tracing the SQL statements (using an IBSQLMonitor
component) is that the sql generated (for the UPDATE statement) does not
have the property as the unicode string entered (i.e. AscII characters ???
etc used).
In my model editor, the property is wideString and the PMapper name is set
to TBoldPMWideString. I have also created the database using the character
set ISO_8859_1.
Any ideas why the update statement is not using the property as a unicode
string?
Sham.
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:4492a10c (AT) newsgroups (DOT) borland.com...
| Quote: |
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
Am I missing a step?
hmm, I just tried it here and the codegen did generate the following :
TNewClass = class(TBusinessClassesRoot)
private
function _Get_M_NewAttribute: TBAWideString;
function _GetNewAttribute: WideString;
procedure _SetNewAttribute(const NewValue: WideString);
protected
public
property M_NewAttribute: TBAWideString read _Get_M_NewAttribute;
property NewAttribute: WideString read _GetNewAttribute write
_SetNewAttribute;
end;
So, don't know what could be the problem you're having, try to create a
test
app and repeat all steps again, I guess.
Regards,
Danny
|
|
|
| Back to top |
|
 |
sham Guest
|
Posted: Mon Jun 19, 2006 5:06 pm Post subject: Re: Unicode for BOLD |
|
|
Hi,
I found that dbExpress and IBX do not support unicode. Is this correct?
If so, which Firebird components should I use and which bold adapter
component do I use (there are only BoldDatabaseAdapterDBX and
BoldDatabaseAdapterIB components available).
Could the above be the reason for the unicode problems?
Sham.
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote in message
news:44967bb6$2 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi Danny,
I have replaced the TBoldEdit component with a TNTEdit component and at
the object space level, the unicode strings seem correct (i.e. assigning
unicode string to object property from a TNTEdit component and then
showing it in another TNTEdit component).
What I found by using by tracing the SQL statements (using an IBSQLMonitor
component) is that the sql generated (for the UPDATE statement) does not
have the property as the unicode string entered (i.e. AscII characters ???
etc used).
In my model editor, the property is wideString and the PMapper name is set
to TBoldPMWideString. I have also created the database using the character
set ISO_8859_1.
Any ideas why the update statement is not using the property as a unicode
string?
Sham.
"Daniel Mauric" <danny at n o s p a m neobee dot net> wrote in message
news:4492a10c (AT) newsgroups (DOT) borland.com...
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
Am I missing a step?
hmm, I just tried it here and the codegen did generate the following :
TNewClass = class(TBusinessClassesRoot)
private
function _Get_M_NewAttribute: TBAWideString;
function _GetNewAttribute: WideString;
procedure _SetNewAttribute(const NewValue: WideString);
protected
public
property M_NewAttribute: TBAWideString read _Get_M_NewAttribute;
property NewAttribute: WideString read _GetNewAttribute write
_SetNewAttribute;
end;
So, don't know what could be the problem you're having, try to create a
test
app and repeat all steps again, I guess.
Regards,
Danny
|
|
|
| Back to top |
|
 |
Daniel Mauric Guest
|
Posted: Thu Jun 22, 2006 3:40 pm Post subject: Re: Unicode for BOLD |
|
|
"sham" <shamresh (AT) inspirationmatters (DOT) com> wrote
| Quote: | I found that dbExpress and IBX do not support unicode. Is this correct?
If so, which Firebird components should I use and which bold adapter
component do I use (there are only BoldDatabaseAdapterDBX and
BoldDatabaseAdapterIB components available).
Could the above be the reason for the unicode problems?
|
You got me interested so I wrote a test app and both adapters work when
configured correctly. I found it neccesary to specify ISO8859_1 as the
ServerCharSet in SQLConnection.Params for DBX and lc_ctype=ISO8859_1 in
IBDatabase params for IBX.
Now, IB/FB apparently store unicode as UTF8, and we are expected to perform
conversions, so I had to modify these two methods:
TBoldPMWideString.ValueToParam
....
Param.AsString := UTF8Encode( aWideString.asWideString );
....
and
TBoldPMWideString.ValueFromField
....
aWideString.AsWideString := UTF8Decode ( Field.AsString );
....
As for the GUI controls I found the use of TBoldStringFollowerController
class to be the problem, as it's used in all Bold aware controls. So to have
unicode Bold aware controls one would have to:
- make controls inherit from appropriate TNT controls
- replace TBoldStringFollowerController with
TBoldWideStringFollowerController
Regards,
Danny |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|