We push 280 characters in one tweet

    Where did the idea come from?


    As you know, twit can be unicode characters, and, as you know, a lot of them.
    Therefore, I thought, why not encode two characters of the Latin alphabet with one Unicode?


    Mute about the mechanism


    About html

    Html uses a lot of special characters that have certain codes.
    Example:
    & # CODE; and compliance:
    • 8364 - €
    • 8658 - ⇒
    • 9827 - ♣

    About ASCII

    When I read the ASCII Wikipedia article, I noticed that the characters (columns and rows are marked) are enough to form a message. And their number does not exceed 100: 6 * 16 = 96.

    Links two events together

    It turns out that two Latin characters can be encoded with one html character!
    Construction & # 98 27; - these are the encoded characters of the Latin alphabet corresponding to one Unicode character!
    It will turn out, if you write a small converter, then you can send a tweet, the number of characters of which will be 2 times more.

    We write a small javascript converter and test it


    After a little arrogance, a converter was born into the world.
    You can test it at:
    http://lucius.0fees.net/bigtwit.html
    Convert the classic phrase: "Hello, World!":
    ࿤ ᶗổ⓯ỉᶏ⏪ - this is what happens.
    Now google the 280-character phrase (with English tight) and post it on Twitter.

    Here you can see the tweet that corresponds to the phrase:
    This is the best known and second most common type of lightning. Of all the different types of lightning, it poses the greatest threat to life and property since it strikes the ground. Cloud-to-ground lightning is a lightning discharge between a cumulonimbus cloud and the ground.


    Afterword


    Why is it needed?

    Suddenly we are on an inhabited island, and we can only send one tweet, because the battery emits the last breath.

    Can shake the archiver?

    Since there are few characters, the desired effectiveness can be achieved only on specially formed phrases.

    Somehow not very optimally encoded, you could still work

    This is so, but I did not begin to develop the idea, because it is generally useless.
    Plus, everything has not been tested to a sufficient extent, so glitches can be observed.

    PS


    Do not scold the code for cattle as you could - and wrote it.

    PS2


    It turns out that under Windows characters are mostly replaced by squares, so copying a message to a tweet will be a problem.
    In general, under Linux, messages will look like this:

    Also popular now: