Forum > LazUtils
About fpttf and fpparsettf
MNeto:
Thanks!
Because the character is UTF16, I modified your code and it worked (I'm using Qt):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses LazUTF16;...var s: string;... s := UnicodeToUTF16($1D435); Label1.Caption := s;
JuhaManninen:
MNeto, "String" is UTF-8 in Lazarus by default. This:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---s := UnicodeToUTF16($1D435);does not make much sense. It only triggers extra automatic conversions.
See:
http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus
--- Quote ---...because characters like #$1D435 does not have correspondent in UTF8.
--- End quote ---
Not true. Data between any Unicode encodings can be converted losslessly.
MNeto:
Really...
It works with UTF8 ...
Now I understand. I thought, incorrectly, unicode SMP could only be represented as UTF16.
Why SMP unicode characters behave differently from BMP unicode characters in Lazarus?
Thank you.
Graeme:
--- Quote from: MNeto on July 13, 2016, 07:38:08 pm ---...but for this range of characters that will not work, because characters like #$1D435 does not have correspondent in UTF8.
--- End quote ---
Uh? All Unicode codepoints can be represented in both UTF-16 and UTF-8.
U+1D435 MATHEMATICAL ITALIC CAPITAL B
UTF-8: 0xF0 0x9D 0x90 0xB5
UTF-16: 0xD835 0xDC35
XML decimal entity: 𝐵
MNeto:
--- Quote ---Uh? All Unicode codepoints can be represented in both UTF-16 and UTF-8.
--- End quote ---
Understand.
I had a wrong idea of the Unicode standard. Sorry, I am not an experienced programmer.
I thought the unicode value of a character was just a number in hexadecimal. I did not know their internal representation.
Navigation
[0] Message Index
[#] Next page
[*] Previous page