Search code examples
htmlencodingcopy-pastecopy-protection

Copy protection on a webpage : dashes


Here is a amazing webpage : Go there

Now, copy a part of the text, for instance, this block :text on the website

And now, paste-it on Notepadd++ (others editor seems not to work for that). Here is a screenshot of the result :same text pasted on Notepadd++

How is this possible? Are there any dashes which cannot be printed on a webpage, but copy-able? I have heard about Copy Protection with JS, but here, I am very surprised...

Any idea about how this is implemented?


Solution

  • It's Soft-Hyphen, an hyphenation authorization. To remove it, try:

    strtr($text, array("\xC2\xAD" => "")); // If you are in UTF-8
    strtr($text, array("\xAD" => "")); // ISO 8859-1
    str_replace('­', '', $text); // html
    

    Let's see in OpenOffice:enter image description here