request for help: connecting to WIN1251 (ANSI) codepaged DB (FB1.0.3) in Lazarus

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

request for help: connecting to WIN1251 (ANSI) codepaged DB (FB1.0.3) in Lazarus

62mkv
Hello ,

  when trying to connect to FB 1.0.3 server, to database that was
  created using WIN1251 (Windows Ansi Cyrillic) CHARSET, via SqlDB
  TIBConnection component, all Lazarus visual components display ASCII
  (32-127) characters OK, but all Cyrillic characters are displayed as
  ????

  I cannot convert DB (anyway, FB 1.0.3 doesn't
  support UTF8) or switch to using another FB.

  I've made requests on several FreePascal\Lazarus forums, all states
  that I need either to migrate to migrate to more recent version of
  FB (most popular advice, which I cannot follow) or "patch" SqlDB
  components so that they should make on-the-fly AnsiToUTF8 and vice versa conversion

  Please tell me, is it the only way, and if yes, than how to do it,
  more exactly, cause I'm a terribly new to Lazarus

Best wishes, 62mkv

mailto: [hidden email]

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: request for help: connecting to WIN1251 (ANSI) codepaged DB (FB1.0.3) in Lazarus

Joost van der Sluis
On Thu, 2010-04-01 at 20:19 +0700, 62mkv wrote:

>   when trying to connect to FB 1.0.3 server, to database that was
>   created using WIN1251 (Windows Ansi Cyrillic) CHARSET, via SqlDB
>   TIBConnection component, all Lazarus visual components display ASCII
>   (32-127) characters OK, but all Cyrillic characters are displayed as
>   ????
>
>   I cannot convert DB (anyway, FB 1.0.3 doesn't
>   support UTF8) or switch to using another FB.
>
>   I've made requests on several FreePascal\Lazarus forums, all states
>   that I need either to migrate to migrate to more recent version of
>   FB (most popular advice, which I cannot follow) or "patch" SqlDB
>   components so that they should make on-the-fly AnsiToUTF8 and vice versa conversion

Why didn't you try that? It's a proper solution.

>   Please tell me, is it the only way, and if yes, than how to do it,
>   more exactly, cause I'm a terribly new to Lazarus

You can try to set the character-set of the FB-client when you connect.
And you can be new to Lazarus, but this has nothing to do with Lazarus
or fpc. It's a FB issue, or more general, a conversion to UTF issue.

Joost.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: request for help: connecting to WIN1251 (ANSI) codepaged DB (FB1.0.3) in Lazarus

Felipe Monteiro de Carvalho
Actually you should use CP1251ToUTF8 for the conversion from the unit
LConvEncoding and not AnsiToUTF8 if you want your code to work
properly in any computer.

AnsiToUTF8 will only correctly if CP1251 is your system encoding.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: request for help: connecting to WIN1251 (ANSI) codepaged DB (FB1.0.3) in Lazarus

Felipe Monteiro de Carvalho
In reply to this post by 62mkv
2010/4/1 62mkv <[hidden email]>:
>  I've made requests on several FreePascal\Lazarus forums, all states
>  that I need either to migrate to migrate to more recent version of
>  FB (most popular advice, which I cannot follow) or "patch" SqlDB
>  components so that they should make on-the-fly AnsiToUTF8 and vice versa conversion

Another solution is not using data-aware controls, read your data
directly from the database though your TDataset object and before
sending the strings to Lazarus convert them using CP1251ToUTF8

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal