Subject Re: [IBO] unable to fix charset and font for TIB_ComboBox
Author Michael Fung
--- In, Helen Borrie <helebor@t...> wrote:
> >tried to set the font settings to chinese at run time but still
> >doesn't help.
> >
> >Any suggestion please? I ma using IBO4.3Aa
> This is a fraught issue, Michael! There are several issues here...
> First, the Charset property of the connection object has to be the
same as
> the default character set of the database. And this Charset
applies only
> to data that are stored as, or extracted as, strings (VARCHAR or
> Delphi converts the Fb/IB number types and displays them as Arabic
> But this Charset property is not the one concerned in your problem.
> The other Charset property is that of the Font attribute of the
> control. It is unrelated to the database Charset (although, of
course, it
> is important that this Charset enables codepage-correct strings to
> written to the database). It needs to be one of the font constants
> in Delphi's TFontCharset type, or a user-defined constant supplied
by the
> vendor of your font - and, of course, this font must be the same as
the one
> that is currently used on the client machine. You can inspect
the "known"
> charset constants in the Delphi help for TFontCharset.
> It gets more complicated (perhaps impossibly so) in data-bound
> controls. Although number types are displayed by way of a number-
> conversion, numerals won't be converted to anything but a string of
one or
> more alphanumeric characters, in the range 0-9, and the locale-
> separators. The behaviour is enscapsulated in the 'AsSomeType'
methods and
> makes a lot of use of variants.
> Some character sets (not talking about database charsets here, but
> "know" about the mapping of arabic alphanumerics to font-specific
> others don't. I don't know of any routine available in English-
> editions of Delphi that supports it. If you are using a Chinese-
> version of Delphi, you might find some kind of language-specific
> support among the various Format routines, that already provides
> capability to intercept OnGetText and/or OnSetText, and display
> alphanumerics using the locale symbols.
> If not, you might be able to achieve what you want, somehow, by
> your own mapping routine, or by Googling for a component or routine
> someone else has already done.
> fwiw, as a guess, I would have tried exactly the strategy that you
> with the TIB_ComboBox. But did you realise that ItemValues is
ignored if
> the TIB_ComboBox.Style property is csDropDown?
> Helen

Dear Helen,

The style property is set to csDropDownList. It works except the
chinese text is not displayed correctly, the data returned to the
database is correct. And of course all required fonts and charset
support is installed on the machine, TIB_Edit, TIB_Memo and TIB_Grid
all can display chinese okay after I set the charset and font. It is
only the TIB_ComboBox not working.