Hey! I just bought MarsEdit and haven't been happier with blog software. However, when I use the bookmarklet sometimes things happen where it'll replace certain characters with bizarre codes. Like, for example, a - will be replaced with like, %2014, or quotes will be replaced with something, and so on and so forth.
Is this a problem with the bookmarklet or the application? Is it avoidable? It's not a horrible problem, but I'd rather not have to look through posts to pull out the codes and replace them with their actual intended characters.
Hi monofonik - it sounds like what you're observing is a phenomenon related to the use of encoded "non-ascii" characters in the page title. For some characters that fall outside the basic set, HTML requires that they be replaced with numeric codes. But it looks like this is throwing off MarsEdit's bookmarklet - so I'll definitely look into it.
To confirm that I understand the bug, here's a test case. Copy/paste the following text into this page's URL field, and hit return. That should cause the page's title to temporarily change to an example title that causes the bug when "Post with MarsEdit" is clicked.
javascript:document.title="Simple Characters — Separated By an Em Dash, or “Called Out With Smart-Quotes”"
Sorry for the inconvenience but I will post here again if I find a workaround before the bug is fixed in MarsEdit.
Samurai Coder's HQ found the issue a while ago (http://samuraicoder.net/double_byte_characters_and_marsedit_bookmarklet) A related issue is that the URL might have double-byte characters in Safari. (In Firefox, international URLs are not supported, so every URL is converted into entities (or whatever they are called). This also causes the same issue. So, both URL and title have the issue.
I was looking into this issue because other bookmarklets provided with Yojimbo and WebnoteHappy work without this issue. But, WebnoteHappy used to have this issue.
It seems that "encodeURIComponent()" is a key. I'm not sure if the application side needs how to accept the URL, title and selected text.
Thanks Takaaki! You led me right to the solution. Indeed, using encodeURIComponent is the right thing to do here, and it makes everything (as far as I can tell) "just work!"
Both of you should try the new bookmarklet I posted on my blog:
Haha! Sucks that the forum software didn't support that. For those who are curious, the ??? are double-byte characters.
I think I see what you mean, Takaaki. At first when you mentioned Windows browsers I thought "who cares?" because nobody will use the bookmarklet from a Windows browser. But I think you mean that if you're blogging about the URL, it needs to be blogged in the fully escaped form - is that right? So that on your blog, Windows users will still be follow the link?
Read between the lines, please. I suck at English. :)
This post I just made (http://takaakiblog.com/post/100469) has double-byte characters which are not converted. I can tell so as far as I check the source in Safari. I'm not sure if these URLs are handled properly in other browsers.