Mailto: command with special character (umlaut) fails

Although this is not directly related to Servoy, maybe someone had the same problem:

We use the following function to create an email in the email client, using the mailto: command.

But as soon as there is the German Umlaut ä in the body text, the client (in my case thunderbird) does not accept the body but creates the email without body.
So whenever we have for example “Dear Mr.Bäcker,” in the body, escape() creates ‘B%E4cker’ for the mailto: and that fails.
When I take out the %E4, it works.

The function creates this, and when I put this to the URL-field of a Chrome browser, the body does not make it:
mailto:john.doe@test.com?subject=testsubject&body=Dear%20Mr%20B%E4cker

This will work, I just took out the %E4:
mailto:john.doe@test.com?subject=testsubject&body=Dear%20Mr%20Baecker

/**
 * Calls the email client with some parameters
 *
 * @author Bernd Korthaus, Sergei Sheinin
 *
 * @param {String} emailAddress
 * @param {String} [subject]
 * @param {String} [body]
 *
 * @properties={typeid:24,uuid:"68F5D004-DB5A-4C2C-80A6-00D5C6942F63"}
 */
function sendEmail(emailAddress, subject, body) {

	// replyTo is not supported by most clients, therefore we did not integrate it
	var
		emailCommand = 'mailto:' + emailAddress,
		parameters = [];

	if (scopes.utils.stringHasContent(subject)) parameters.push('subject=' + escape(subject));

	if (scopes.utils.stringHasContent(body)) parameters.push('body=' + escape(body));

	if (parameters.length > 0) {

		emailCommand += '?' + parameters.join('&');
	}

	if (scopes.svySystem.isWindowsPlatform()) {

		application.executeProgram('rundll32.exe', ['url.dll,FileProtocolHandler', emailCommand]);

		application.output(emailCommand);
	}
	else {
		application.showURL(emailCommand);
	}
}

Try URL encoding your strings:

=>escape("Dear Mr.Bäcker")
Dear%20Mr.B%E4cker

=>encodeURI("Dear Mr.Bäcker")
Dear%20Mr.B%C3%A4cker

=>encodeURIComponent("Dear Mr.Bäcker")
Dear%20Mr.B%C3%A4cker

Thanks a lot, David, encodeURI worked at once.