From: hackbard Date: Sun, 15 Oct 2017 08:24:03 +0000 (+0200) Subject: more umlaute and sonderzeichen X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=6c074d791fc6e40ee944b5bab11c717093749114;p=outofuni%2Fjsutils.git more umlaute and sonderzeichen --- diff --git a/utils.js b/utils.js index 0d78e8b..a63f0af 100644 --- a/utils.js +++ b/utils.js @@ -34,14 +34,22 @@ function vert_align_text(trg) { } function html2ascii(str) { + str=str.replace(/\Ä\;/g,"Ä"); + str=str.replace(/\Ö\;/g,"Ö"); + str=str.replace(/\Ü\;/g,"Ü"); str=str.replace(/\ä\;/g,"ä"); str=str.replace(/\ö\;/g,"ö"); str=str.replace(/\ü\;/g,"ü"); str=str.replace(/\ß\;/g,"ß"); + str=str.replace(/\&\;/g,"&"); return str; } function ascii2html(str) { + str=str.replace(/&/g,"&"); + str=str.replace(/Ä/g,"Ä"); + str=str.replace(/Ö/g,"Ö"); + str=str.replace(/Ü/g,"Ü"); str=str.replace(/ä/g,"ä"); str=str.replace(/ö/g,"ö"); str=str.replace(/ü/g,"ü");