<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><div></div><div>Hope itโ€™s useful for you. If you improve the code pls let me know.</div><div><br></div><div>Best regards,</div><div>Jeroen</div><div><br></div><div><br></div><div><br><div>On 2 Jul 2023, at 15:30, Hairy Pixels via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote:</div><br class="Apple-interchange-newline"><div><div>I'm interested in parsing unicode scalars (I think they're called) to byte sized values but I'm not sure where to start. First thing I did was choose the unicode scalar U+1F496 (๐Ÿ’–).<br><br>Next I cheated and ask ChatGPT. :) Amazingly from my question it was able to tell me the scaler is comprised of these 4 bytes:<br><br> 240 159 146 150<br><br>I was able to correctly concatenate these characters and writeln printed the correct character.<br><br>var<br><span class="Apple-tab-span" style="white-space:pre">       </span>s: String;<br>begin<br>s := char(240)+char(159)+char(146)+char(150);<br>writeln(s);<br>end.<br><br>The question is, how was 1F496 decomposed into 4 bytes? <br><br>Regards,<br><span class="Apple-tab-span" style="white-space:pre">       </span>Ryan Joseph<br><br>_______________________________________________<br>fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org<br>https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal<br></div></div></div><br></div></body></html>