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

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

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

silvioprog
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:


In Pascal, how to convert $00C1 to show Á?

Thank you!

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

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

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

dmitry boyarintsev
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





On Wed, Jul 23, 2014 at 8:12 PM, silvioprog <[hidden email]> wrote:
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 = &Aacute;), the all characteres list here:


In Pascal, how to convert $00C1 to show Á?

Thank you!

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

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

José Mejuto
In reply to this post by silvioprog
El 24/07/2014 2:12, silvioprog escribió:

> In JavaScript, if I code:
>
> alert('\u00C1');
>
> It shows:
>
> Á
>
> Is \u00C1 of JS same to $00C1 in Pascal?
>

Hello,

\u means Unicode char, so "\u00c1" = #$00C1 (widestring)

--

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

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

silvioprog
In reply to this post by dmitry boyarintsev
On Wed, Jul 23, 2014 at 9:49 PM, Dmitry Boyarintsev <[hidden email]> 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

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

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

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

Just a comment...

I found the HTML entities in PHP source code:


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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal