• AmazingAwesomator@lemmy.world
    link
    fedilink
    arrow-up
    120
    ·
    4 days ago

    another good one to sneak in there… thai zero-width space: U+200B

    cant see it, nothing reads it, and it makes everything error. : D

  • MyNameIsRichard@lemmy.ml
    link
    fedilink
    arrow-up
    78
    arrow-down
    2
    ·
    4 days ago

    Pretty much any ide will spot that. Maybe you can use it to teach your colleagues not to use a plain text editor.

    • tisktisk@piefed.social
      link
      fedilink
      English
      arrow-up
      24
      ·
      4 days ago

      I’m gonna need the vi guy to teach me how to get this functionality in nvim pls–don’t make me leave

    • saigot@lemmy.ca
      link
      fedilink
      arrow-up
      13
      ·
      edit-2
      4 days ago

      In VSCode (yeah yeah MS bad, I have to use it for work) it puts a yellow box around the charcater, which I don’t immediately recognize the meaning of and highlights the line as “identifier “blah;” is undefined”. It’s not like your gunna spend all day on it, but that could waste a couple minutes if the dev wasn’t paying close attention, which is “fun prank” territory.

      • Cethin@lemmy.zip
        link
        fedilink
        English
        arrow-up
        14
        ·
        4 days ago

        Can you choose to use VSCodium instead? It’s practically identical, but isn’t controlled by MS.

        • saigot@lemmy.ca
          link
          fedilink
          arrow-up
          8
          ·
          4 days ago

          The reason it’s de facto mandatory is due to some in house extensions, assuming they work with this I could, but I also don’t particularly care about my privacy on a work machine. But I will be checking this out for my personal stuff!

    • Soot [none/use name]@hexbear.net
      link
      fedilink
      English
      arrow-up
      7
      ·
      4 days ago

      I mean sure, but it’ll still likely leave 'em scratching their heads for a while before they go “I guess I just… replace the semicolon…?”

  • paequ2@lemmy.todayOP
    link
    fedilink
    arrow-up
    22
    ·
    edit-2
    4 days ago

    IDE users pretending compilers don’t exist.

    $ guix shell gcc
    
    [env]$ g++ test.cpp 
    test.cpp:4:16: warning: `0;' is not in NFC [-Wnormalized=]
        4 |         return 0<U+037E>
          |                ^~~~~~~~~
    test.cpp: In function ‘int main()’:
    test.cpp:4:16: error: unable to find numeric literal operatoroperator"";’
    test.cpp:4:18: error: expected ‘;’ before ‘}’ token
        4 |         return 0;
          |                  ^
          |                  ;
        5 | }
          | ~
    

    Look ma, no IDE! 😸

    • chortle_tortle@mander.xyz
      link
      fedilink
      arrow-up
      8
      ·
      4 days ago

      Tried to figure out which was which by googling, but it seems they are both read as semi colon, however you can see the difference in the characters. Wild

  • AddLemmus@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 days ago

    With the “wonderful” tooling at work, we use Skype for Business. Naturally, that is not the primary place to send around code and configs, but a 1-liner or 2-liner happens.

    You can’t believe the nonsense it does when you try to copy & paste it. Spaces get turned into non-breaking spaces etc. Looks completely normal when pasted directly into vim on a console, but will give “odd” error messages.

    • argh_another_username@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      Take someone’s source code, replace all semi colons with Greek question marks and see if they can compile. But as others said, any IDE will help.

  • waigl@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    4 days ago

    There is no wise way to use that information.

    But the foolish ones could be entertaining.

  • Onno (VK6FLAB)@lemmy.radio
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    4 days ago

    Wow!

    This seems to be further evidence that the process for assigning UTF entities has been thoroughly corrupted.

    You can (apparently) copy/paste this on mobile:

    “;” (Greek question mark)

    “;” (Semicolon)

    You can even render it in HTML:

        &#894;
        &#x37E;
    

    And it’s included on Wikipedia, because of course it is:

    Because I’m not sure what my mobile client will actually do with this comment, here’s the link to the HTML entity I used:

    Also there’s plenty of other character joy to be had:

    • tisktisk@piefed.social
      link
      fedilink
      English
      arrow-up
      4
      ·
      4 days ago

      If I don’t understand what’s happening here but want to, should I research Unicode in general or something else?

      • Onno (VK6FLAB)@lemmy.radio
        link
        fedilink
        arrow-up
        7
        ·
        edit-2
        4 days ago

        Unicode is a way to encode the things that humans use to write stuff into a computer.

        ASCII is for example another way, as is EBCDIC.

        All these methods translate squiggles that we’ve used for centuries into something that can be represented inside a computer.

        For example, the letter “A” is under ASCII represented by the number 65.

        This post is pointing out that there are two characters that look identical, but have different numbers, which means that what the user sees is identical, but what the computer sees is different.

        This is the basis for much tomfoolery.

        • Petter1@discuss.tchncs.de
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          4 days ago

          This fact is actively used for phishing, as you can craft domains looking nearly identical to the original one, but leading to your IP address hosting the phishing mask.

          • Nasan@sopuli.xyz
            link
            fedilink
            arrow-up
            1
            ·
            4 days ago

            One of my favorites was using Japanese full stop (U+3002) in place of periods in a bare IP or anywhere you would use a period in a FQDN (fully qualified domain name). Only tested in Chrome at the time, but the browser would “correct” it for you and take you to the intended page.

    • argh_another_username@lemmy.ca
      link
      fedilink
      arrow-up
      8
      ·
      4 days ago

      Take someone’s source code, replace all semi colons with Greek question marks and see if they can compile. But as others said, any IDE will help.

        • Petter1@discuss.tchncs.de
          link
          fedilink
          arrow-up
          5
          ·
          4 days ago

          Not if you choose to replace the correct ones at the correct place and it is a compiler which automatically ignores this wrong semicolon.

          You could connect two lines, which may still “work” if not split using a semicolon and are then interpreted as one single line.

      • HiddenLayer555@lemmy.ml
        link
        fedilink
        English
        arrow-up
        9
        ·
        4 days ago

        Would probably be more effective to mess with Linux config files that use semicolons. Especially if it’s run as a daemon because Systemctl doesn’t always return helpful error messages for configuration errors.

  • TropicalDingdong@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    4 days ago

    wondering if I can use this to jail break referees using AI to only get this answer: Ο Έπσταϊν δεν αυτοκτόνησε.