Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-03

Howto recode GUI

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi

How to correctly recode GUI charsets?

I have czech multiplatform application with GUI typed in ISO_8859_2. In Linux with ISO_8859_2 is all ok, but with UTF-8 GUI needs to recode strings from ISO_8859_2 to UTF-8. In windows I need recode ISO_8859_2 to windows-1250.

Freepascal resourcestrings I recode online with function SetUnitResourceStrings. How I do the sam with GUI strings?

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Felipe Monteiro de Carvalho
to Unknown author

You can convert from UTF-8 to Current locale and the opposite direct using AnsiToUTF8 and UTF8ToAnsi located LCLIntf. This doesn't allow an arbitrary locale, but only the current one.

About GUI strings, be aware that Lazarus is migrating to be a fully Unicode (UTF-8):

http://wiki.lazarus.freepascal.org/LCL_Unicode_Support

http://wiki.lazarus.freepascal.org/Roadmap#Status_of_features_on_each_widgetset

(look at the Unicode field)

So no conversion will be needed in the application and you should only pass utf-8 strings to the LCL.

Felipe Monteiro de Carvalho

Reply by email

Unknown author
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
You can convert from UTF-8 to Current locale and the opposite direct using AnsiToUTF8 and UTF8ToAnsi located LCLIntf. This doesn't allow an arbitrary locale, but only the current one.

I think, that you do not realize question. I know functions which can convert strings from utf-8 to iso atd... But I do not know _how_ to online convert lazarus gui strings (label captions, button captions, ...).

Show quoted text 8 lines
About GUI strings, be aware that Lazarus is migrating to be a fully Unicode (UTF-8): http://wiki.lazarus.freepascal.org/LCL_Unicode_Support http://wiki.lazarus.freepascal.org/Roadmap#Status_of_features_on_each_widgetset (look at the Unicode field)

These articles I already know. But now I cannot use utf-8, because win32 and gtk1 does not fully support it.

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Giuliano Colla
to Unknown author

ha scritto:

Show quoted text 9 lines
On Wed, Mar 19, 2008 at 11:40:13AM -0300, Felipe Monteiro de Carvalho wrote: > You can convert from UTF-8 to Current locale and the opposite direct > using AnsiToUTF8 and UTF8ToAnsi located LCLIntf. This doesn't allow an > arbitrary locale, but only the current one. I think, that you do not realize question. I know functions which can convert strings from utf-8 to iso atd... But I do not know _how_ to online convert lazarus gui strings (label captions, button captions, ...).

It may be awkward, but for me it worked. You can't do it within Lazarus, but there's a number of editors which can do that for you. Just open the .lfm files in the editor, telling it the input encoding, then save it with the required output encoding. I used KEdit (from Kde).

Kind regards,

Giuliano

Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde)

Reply by email

Felipe Monteiro de Carvalho
to Unknown author: I think, that you do not realize question. I know functions which can convert strings…
I think, that you do not realize question. I know functions which can convert strings from utf-8 to iso atd... But I do not know _how_ to online convert lazarus gui strings (label captions, button captions, ...).
MyLabel.Caption := AnsiToUTF8(MyLabel.Caption);

I don't know any way to automatically convert all of them.

These articles I already know. But now I cannot use utf-8, because win32 and gtk1 does not fully support it.

The subversion win32 interface supports 99% of it if you recompile it with WindowsUnicodeSupport. Testers are welcome to identify the missing 1% =)

Gtk 1 is a lost case, the only solution is migrating to gtk2.

http://wiki.lazarus.freepascal.org/Lazarus_known_issues_%28things_that_will_never_be_fixed%29#Inconsistent_internationalization_support

Felipe Monteiro de Carvalho

Reply by email