Sign in Join

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

Mailing lists / lazarus / 2015-04

upper & lower case problem

15 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

FreeMan

fpc r30616 & lazarus r48768 yosemite x64qt
I added test form and unit. I added screenshot 'cos in code Upper__ variable and How view in form much better then write. Upperxxxcase hide dots Is this bug in lazarus or fpc ? or what worng ?
That spells are Turkish spells.
Thank you

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150419/15289508/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: cchigaed.
Type: image/jpeg
Size: 55514 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150419/15289508/attachment-0001.jpe> -------------- next part --------------
unit Unit1;

{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
  { TForm1 }
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var Lower__, Upper__ : string;
begin
  Lower__ := '??????'; Upper__ := '??????';
  Label1.Caption := 'Lower__ :(' + Lower__ + ') ' +
                    AnsiUpperCase(Lower__) + ' - ' +
                    UpperCase(Lower__) + ' - ' +
                    WideLowerCase(Lower__);
  Label2.Caption := 'Upper__ :(' + Upper__ + ') ' +
                    AnsiLowerCase(Upper__) + ' - ' +
                    LowerCase(Upper__) + ' - ' +
                    WideLowerCase(Upper__);
end;

end.
-------------- next part --------------
object Form1: TForm1
Left = 421
Height = 96
Top = 107
Width = 483
Caption = 'Form1'
ClientHeight = 96
ClientWidth = 483
LCLVersion = '1.5'
object Button1: TButton
Left = 8
Height = 25
Top = 56
Width = 75
Caption = 'Button1'
OnClick = Button1Click
TabOrder = 0

  end
  object Label1: TLabel
    Left = 8
    Height = 13
    Top = 8
    Width = 39
    Caption = 'Label1'
    Font.CharSet = TURKISH_CHARSET
    ParentColor = False
    ParentFont = False
  end
  object Label2: TLabel
    Left = 8
    Height = 13
    Top = 38
    Width = 39
    Caption = 'Label2'
    Font.CharSet = TURKISH_CHARSET
    ParentColor = False
    ParentFont = False
  end

end

Reply by email

Juha Manninen
to FreeMan
FreeMan wrote 6 lines
fpc r30616 & lazarus r48768 yosemite x64qt I added test form and unit. I added screenshot 'cos in code Upper__ variable and How view in form much better then write. Upperxxxcase hide dots Is this bug in lazarus or fpc ? or what worng ? That spells are Turkish spells.

Did you follow the instructions here :
http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150419/252885bd/attachment.html>

Reply by email

FreeMan
to Juha Manninen: On Sun, Apr 19, 2015 at 7:59 PM, FreeMan Did you follow the instructions here :…

I did all of them but result not change.
You saw code & label's caption,
1-) lower & upper case not change chars.
2-)Upper case hide dots. This is much important, example: "?OCUK ?LD?" --> showing in label "?OCUK OLDU" if translate: "?OCUK ?LD?" mean"CHILD DIED" --> "?OCUK OLDU" mean"CHILD BORN" so, this is much important in hospital application.

Juha Manninen wrote 5 lines
Did you follow the instructions here : http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus Juha

Reply by email

FreeMan
to Vojtěch Čihák: I just tested on Qt (Lazarus 1.5 r48755M FPC 3.1.1 x86_64-linux-qt) and works well. Isn't…
Vojt?ch ?ih?k wrote 6 lines
I just tested on Qt (Lazarus 1.5 r48755M FPC 3.1.1 x86_64-linux-qt) and works well. Isn't it wrong autosizing of TLabel on GTk2 rather than some encoding problem?

There is no resize problem, I wrote, encoding problem. I wrote answer to Juha's mail, why important.
TLabel "?LD?" painting "OLDU"
translate to english
TLabel "DIED" painting "BORN"
codepage has been big problem in this year :(

Reply by email

zeljko
to FreeMan
FreeMan wrote 13 lines
On 20.04.2015 00:17, Vojt?ch ?ih?k wrote: > > I just tested on Qt (Lazarus 1.5 r48755M FPC 3.1.1 x86_64-linux-qt) > > and works well. Isn't it wrong autosizing of TLabel on GTk2 rather > than some encoding problem? > There is no resize problem, I wrote, encoding problem. I wrote answer to Juha's mail, why important. TLabel "?LD?" painting "OLDU" translate to english TLabel "DIED" painting "BORN" codepage has been big problem in this year :(

Why translation ? AFAIR, you used (I've deleted original post), UpperCase, or AnsiUpperCase, and IMO that's wrong. Have you tried with UTF8UpperCase (or UpperCaseUTF8) from LazUTF8 ?

zeljko

Reply by email

Juha Manninen
to zeljko
zeljko wrote 11 lines
On 04/20/2015 10:40 AM, FreeMan wrote: > There is no resize problem, I wrote, encoding problem. I wrote answer to > Juha's mail, why important. > TLabel "?LD?" painting "OLDU" > translate to english > TLabel "DIED" painting "BORN" > codepage has been big problem in this year :( Why translation ? AFAIR, you used (I've deleted original post), UpperCase, or AnsiUpperCase, and IMO that's wrong. Have you tried with UTF8UpperCase (or UpperCaseUTF8) from LazUTF8 ?

AnsiUpperCase should work when the "Better Unicode Support" is configured. All UTF8...() functions in LazUTF8 are set as backends for RTL's Ansi...() functions.

Yes, I can imagine such translation errors can cause problems. I think this one is a bug in UTF8UpperCase (called by AnsiUpperCase). I always wondered how it can work when there are many decomposed characters and language dependent differences.
Please report with a minimal test application.

Juha

Reply by email

Juha Manninen
to Juha Manninen

No, I should have tested properly before replying. It works perfectly well here. I created a project and "Set UTF-8 in RTL". A screenshot is attached and it looks very different from yours. You are doing something wrong.

Juha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TurkishUnicode.png
Type: image/png
Size: 15838 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150420/fd50a236/attachment-0001.png>

Reply by email

Juha Manninen
to FreeMan: fpc r30616 & lazarus r48768 yosemite x64qt I added test form and unit. I added screenshot…
FreeMan wrote
fpc r30616 & lazarus r48768 yosemite x64qt

One more thing: update your Lazarus trunk.
Just recently r48776 improved things in Unix systems. You don't need to use "cwstring" explicitly any more, it is done automatically with -dEnableUTF8RTL.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150420/1dbc7953/attachment.html>

Reply by email

FreeMan
to zeljko: Why translation ? AFAIR, you used (I've deleted original post), UpperCase, or…

Thank you,
LazUTF8 is solution for me. But not perfect,
Upper "I" lower "?"
Upper "?" lower "i"
not correctly convert this two spells
Why translation ? 'cos why much important for me, for telling good way

zeljko wrote 5 lines
Why translation ? AFAIR, you used (I've deleted original post), UpperCase, or AnsiUpperCase, and IMO that's wrong. Have you tried with UTF8UpperCase (or UpperCaseUTF8) from LazUTF8 ? zeljko

Reply by email

FreeMan
to Juha Manninen: AnsiUpperCase should work when the "Better Unicode Support" is configured. All UTF8...()…

I added my test project, but you made, I saw your screenshots.yes view in are normal. If I'm not wrong that screen in linux, I'm on osx and x64 qt. Maybe problem on osx qt
My lazarus svn r48779.
Sorry Juha, while testing zeljko's suggestion, you wrote. In LazUTF8 UTF8xxxxCase work good for me. But viewing problem still have it. I mean Upper case spell has dot but not painting. In IDE as well. Type '??????I' to caption property of tlabel from object inspector, in form: dots not painting
in Object inspector: caption property is selected(focused) if text is selected, dot not painting
if text is not selected dot painting
caption property is NOT selected(not focused)
dots not painting.

Juha Manninen wrote 11 lines
AnsiUpperCase should work when the "Better Unicode Support" is configured. All UTF8...() functions in LazUTF8 are set as backends for RTL's Ansi...() functions. Yes, I can imagine such translation errors can cause problems. I think this one is a bug in UTF8UpperCase (called by AnsiUpperCase). I always wondered how it can work when there are many decomposed characters and language dependent differences. Please report with a minimal test application. Juha

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_For_Case.7z
Type: application/x-7z-compressed
Size: 60253 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150420/45d2d361/attachment-0001.bin>

Reply by email

Juha Manninen
to FreeMan
FreeMan wrote 5 lines
in Object inspector: caption property is selected(focused) if text is selected, dot not painting if text is not selected dot painting caption property is NOT selected(not focused) dots not painting.

I don't see any such errors with Linux + QT. You should try Carbon or Cocoa with OSX.
BTW, AnsiUpperCase / AnsiLowerCase are the right functions to use with the new UTF-8 support in Lazarus.
It is even Delphi compatible even though they use different character encoding internally.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen: AnsiUpperCase should work when the "Better Unicode Support" is configured. All UTF8...()…
Show quoted text 21 lines
On Mon, Apr 20, 2015 at 11:48 AM, zeljko wrote: > On 04/20/2015 10:40 AM, FreeMan wrote: >> There is no resize problem, I wrote, encoding problem. I wrote answer to >> Juha's mail, why important. >> TLabel "?LD?" painting "OLDU" >> translate to english >> TLabel "DIED" painting "BORN" >> codepage has been big problem in this year :( > > Why translation ? AFAIR, you used (I've deleted original post), UpperCase, > or AnsiUpperCase, and IMO that's wrong. Have you tried with UTF8UpperCase > (or UpperCaseUTF8) from LazUTF8 ? AnsiUpperCase should work when the "Better Unicode Support" is configured. All UTF8...() functions in LazUTF8 are set as backends for RTL's Ansi...() functions. Yes, I can imagine such translation errors can cause problems. I think this one is a bug in UTF8UpperCase (called by AnsiUpperCase). I always wondered how it can work when there are many decomposed characters and language dependent differences.

Decomposed characters are helping. Language dependency is a problem. Turkish is the prominent example.
At the moment the default is to not use the "LANG". This needs to be changed.

Please report with a minimal test application.

+1

Mattias

Reply by email

FreeMan
to Mattias Gaertner

Been late sorry,
Is this bug on fpc or lazarus? I mean I create issue but which section? Thank you.

Mattias Gaertner wrote 10 lines
> characters and language dependent differences. Decomposed characters are helping. Language dependency is a problem. Turkish is the prominent example. At the moment the default is to not use the "LANG". This needs to be changed. > >Please report with a minimal test application. +1 Mattias

Reply by email

Mattias Gaertner
to FreeMan
Been late sorry, Is this bug on fpc or lazarus? I mean I create issue but which section? Thank you.

Create it first as Lazarus LCL. If the
problem lies deeper we can move it.

Mattias

Show quoted text 9 lines
On 20.04.2015 20:09, Mattias Gaertner wrote: >> characters and language dependent differences. > Decomposed characters are helping. Language dependency is a problem. > Turkish is the prominent example. > At the moment the default is to not use the "LANG". > This needs to be changed. > >> >Please report with a minimal test application. > +1

Reply by email