ascii - Trouble making a heart symbol in Lua? -


I was wondering how to do in the heart sign or "♥" lu, I tried Is \ 003 because it is the ASCII code for it, but it does not print.

There is nothing to do with Lua

You have to find out that Which character sets and encodings are used in your environment and select the font that supports ♥ in that encoding.

Then you need to use an editor for your Leah script which saves it in that encoding. If that part is not possible, then you can determine the required byte sequence, it can save the code as a numerical escape in a literal string and in the corresponding encoding like CP437. For example, if you are output to the UTF-8 processor, "\ xE2 \ x99 \ xA5"

Keep in mind that the string sequence is calculated by the string string bytes. It is up to you and your editor to insert the correct bytes in the file, depending on your environment (such as the console), to interpret those bytes in those special character encoding, and the font to display the glyph.

In a Windows console, you can select the Lucinda Console font, chcp 65001 to use UTF-8 and so use Lua 5.1: lua -e "print ('\ 226 \ 153 \ 165')" . As a comparison, use IBM437 and Lua 5.1 to use chcp 437 like this: lua -e "print ('\ 003')" .


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -