Recent

Author Topic: [Solved] i can't get char "é"?  (Read 5625 times)

majid.ebru

  • Hero Member
  • *****
  • Posts: 530
Re: [Solved] i can't get char "é"?
« Reply #15 on: January 20, 2019, 09:02:27 pm »
how can i show first char???
Code: Pascal  [Select][+][-]
  1. uses LazUnicode;
  2.  
  3. procedure TForm1.Button1Click(Sender: TObject);
  4. var
  5.   S: string;
  6. begin
  7.   S := 'êtes ';
  8.   ShowMessage(S + LineEnding + '"' + CodePointCopy(S, 1, 1) + '"');
  9. end;

oooooohhhhhh   my god


help me please

your code did not work for an array

why ?!?!?1
Code: Pascal  [Select][+][-]
  1. procedure TF1.Button2Click(Sender: TObject);
  2. var
  3.   Voule_V01 : array[0..5] of UTF8String = ('a','e','é','ê','h','o');
  4.   i:Byte;
  5. begin
  6.   //t_Str_2 := 'êtes ';
  7.   for i := Low(Voule_V01) to High(Voule_V01) do
  8.     ShowMessage(Voule_V01[i] + LineEnding + '"'
  9.       + CodePointCopy(Voule_V01[i], 1, 1) + '"');
  10. end;  
  11.  

i change :
Code: Pascal  [Select][+][-]
  1. var
  2.   Voule_V01 : array[0..5] of UTF8String = ('azz','ezz','ézz','êzz','hzz','ozz');
  3.  


but it did not work
« Last Edit: January 20, 2019, 09:06:27 pm by majid.ebru »

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: [Solved] i can't get char "é"?
« Reply #16 on: January 20, 2019, 09:40:47 pm »
Have you changed the default codepage of your source? I mean, do you have a {$codepage whatever} somewhere? Because it looks as if your constants were not being interpreted as UTF8.

If not, it should work. I tested my code here and it does work without problems and ASerge's should work just the same.
« Last Edit: January 20, 2019, 09:44:47 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

majid.ebru

  • Hero Member
  • *****
  • Posts: 530
Re: [Solved] i can't get char "é"?
« Reply #17 on: January 21, 2019, 03:15:49 pm »
hi

i change my code:

UTF8string -> AnsiString

Code: Pascal  [Select][+][-]
  1. Voule_V01 : array[0..5] of AnsiString{UTF8String} = ('a','e','é','ê','h','o');
  2.  

it worded.

thank you

 

TinyPortal © 2005-2018