Coffeehouse Thread

13 posts

Notepad Trick? "this api can break"

Back to Forum: Coffeehouse
  • User profile image
    jsampsonPC

    Alright, so I just learned something neat.
    Open up Notepad, and type the following

    this api can break
    Now, save it as foo.txt and close it.
    No go open it Wink

    Microsoft...ya'll gotta fix this stuff now, come on!

  • User profile image
    IRenderable

    It does that with any 4 word sentence with a 4,3,3, and 5 letters words in that order.

  • User profile image
    Xaero_​Vincent

    LOL that is amusing.

    I wonder how many more bugs one could scope out with such primitive tests.


    Regards,
    Vincent

  • User profile image
    Angus

    That is strange, I wonder why it happens.

    Thanks for that.

    Angus Higgins

  • User profile image
    gregoryw
  • User profile image
    shreyasonli​ne

    Cool ... But the file is saved properly, I mean you can get the original text if you open the file in wordpad.

    Shreyas Zare

  • User profile image
    IRenderable

    "Bush hid the facts"

    OMG CONSPIRACY!

  • User profile image
    Jason Cox

    IRenderable wrote:
    "Bush hid the facts"

    OMG CONSPIRACY!
    Baghdad Bob: There is no bug in Notepad! That is a feature, not a bug!

  • User profile image
    Cybermagell​an

    Angus wrote:
    That is strange, I wonder why it happens.

    Thanks for that.

    Angus Higgins


    If I remember right it's something like the order of that has some encoding at the end of it, that when opened back up Notepad doesn't know how to read it.

  • User profile image
    ploe

    wordpad seems to open it up fine

  • User profile image
    Steve411

    Cybermagellan wrote:
    
    Angus wrote: That is strange, I wonder why it happens.

    Thanks for that.

    Angus Higgins


    If I remember right it's something like the order of that has some encoding at the end of it, that when opened back up Notepad doesn't know how to read it.


    If notepad is allowed to save the content with the encoding i should be able to properly read it as well.

  • User profile image
    shreyasonli​ne

    Steve411 wrote:
    
    Cybermagellan wrote:
    Angus wrote: That is strange, I wonder why it happens.

    Thanks for that.

    Angus Higgins


    If I remember right it's something like the order of that has some encoding at the end of it, that when opened back up Notepad doesn't know how to read it.


    If notepad is allowed to save the content with the encoding i should be able to properly read it as well.


    Ya you are right ... but, if you modify notepad with all the stuff you need, it would become wordpad Wink

    Shreyas Zare

  • User profile image
    Matthew van Eerde

    When Notepad opens up a file it doesn't know whether it's 8-bit ANSI or 16-bit UTF-16 (technically UCS-2.)

    So it makes an educated guess, based on high/low byte analysis heuristics.

    In the examples cited, the string looks UCS-2-ish to Notepad.

    More on Michael Kaplan's blog

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.