Sign in Join

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

Mailing lists / fpc-pascal / 2014-07

JS: \u00C1 = Á; Pascal: $00C1 = ?

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Dmitry Boyarintsev
to silvioprog

I'd think that "show" requires a definition here.

For example in LCL application

ShowMessage( utf8encode( WideString(#$00c1)));
shows Á.

In most unix consoles

  Writeln( WideString(#$00c1));

would output the same character as well.

thanks,
Dmitry

silvioprog wrote 29 lines
Hello, In JavaScript, if I code: alert('\u00C1'); It shows: Á Is \u00C1 of JS same to $00C1 in Pascal? I'm trying to make a function to named-character convertions (e.g.: \u00C1 = Á), the all characteres list here: http://www.w3.org/TR/html5/syntax.html#named-character-references In Pascal, how to convert $00C1 to show Á? Thank you! -- Silvio Clécio My public projects - github.com/silvioprog _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

silvioprog
to Dmitry Boyarintsev: I'd think that "show" requires a definition here. For example in LCL application…

On Wed, Jul 23, 2014 at 9:49 PM, Dmitry Boyarintsev <

Show quoted text 13 lines
wrote: I'd think that "show" requires a definition here. For example in LCL application ShowMessage( utf8encode( WideString(#$00c1))); shows Á. In most unix consoles Writeln( WideString(#$00c1)); would output the same character as well.

It worked like a charm!

I did:

var
  s: WideString;
  sl: TStringList;
begin
  s := #$02229#$0FE00;
  sl := TStringList.Create;
  try
    sl.Text := UTF8Encode(s);
    sl.SaveToFile('test.txt');
  finally
    sl.Free;
  end;
end;

And the content in 'test.txt' is ∩︀ (Windows/Linux).

Thank you very much Dmitry!

Silvio Clécio My public projects - github.com/silvioprog

Reply by email

silvioprog
to silvioprog

On Wed, Jul 23, 2014 at 10:57 PM, silvioprog wrote: [...]

Just a comment...

I found the HTML entities in PHP source code:

HTML basic (6 chars):
https://github.com/php/php-src/blob/master/ext/standard/html_tables/ents_basic.txt ;
HTML 4.01 (253 chars):
https://github.com/php/php-src/blob/master/ext/standard/html_tables/ents_html401.txt ;
XHTML (253 chars):
https://github.com/php/php-src/blob/master/ext/standard/html_tables/ents_xhtml.txt ;
HTML 5 (2,125 chars):
https://github.com/php/php-src/blob/94e15ff3877f842e5eb5c89e3aeab214fb4a3a33/ext/standard/html_tables/ents_html5.txt (I'll implement for that).

Silvio Clécio My public projects - github.com/silvioprog

Reply by email