I have a program like this: --------- program print; begin writeln(#$d790); // Should…
Try this: (a char is only one byte, you're trying to print a multi-byte character: print multiple one-byte characters)
WriteLn(#$d7, #$90);

Mailing lists / fpc-pascal / 2012-11
7 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I have a program like this: --------- program print; begin writeln(#$d790); // Should…
Try this: (a char is only one byte, you're trying to print a multi-byte character: print multiple one-byte characters)
WriteLn(#$d7, #$90);
Hello,
I have a program like this:
---------
program print;
begin
writeln(#$d790); // Should print א
end.
----------I print this to a file:
./program > file
In hex editor the value 3F A0
It also the same on normal terminal.
I'm using Free Pascal Compiler version 2.6.0 [2012/05/17] for x86_64 Under Linux.
What am I missing or doing wrong ?
Thanks,
Ido
[snip]
What am I missing or doing wrong ?
a) add "uses cwstring" to get a full unicodestring manager in your program
b) the unicode code point for א is $05d0, not $d790
Jonas
When using cwstring, it writes $ED $9E $90 $0A
The Only correct char here is $0A (\n).
b) the unicode code point for א is $05d0, not $d790
I'm trying to use UTF-8, not UTF-16 ($05d0 is UTF-16 values)
Try this: (a char is only one byte, you're trying to print a multi-byte character: print…
Ewald wroteTry this: (a char is only one byte, you're trying to print a multi-byte character: print multiple one-byte characters) WriteLn(#$d7, #$90);
Breaking it into two bytes works.
When using cwstring, it writes $ED $9E $90 $0A The Only correct char here is $0A (\n).…
ik wrote on ma, 05 nov 2012:
[snip]
I'm trying to use UTF-8, not UTF-16 ($05d0 is UTF-16 values)
#$XXXX means "define a widechar constant with this value", and widechars are always UTF-16. As mentioned in your later mail, if you want to define individual byte values, you have to define them as individual bytes.
Jonas
you are right, sorry.
All work and not enough sleep ... :)