🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #264634

Re: [40tude] Edit -> Find regular expression?

#264634
From: mike
Date: Thu, 21 Jan 2021 23:40
68 lines
3261 bytes
VanguardLH wrote:

> Seems if you're pasting into your compose window, that you could first
> paste into something else, like a word processor, where you could
> specify the string to find and what to replace it with, copy the result,
> and paste that into your compose window.

   This is a test of OnBeforeSendingMessage with ä, ö, ü

If I can't get the script Bernd suggested to work, then I have to manually
clean out the body as you said, by pasting into my gVIM editor on Windows.
         :%s/[control+-q+-147,control+-q+-148]/"/g
That will replace all instances of opening or closing curly doublequotes
with straight doublequotes.

But I was hoping this program that Bernd Rose suggested would work
(where I replaced my existing OnBeforeSendingMessage in its entirety)
with this which Bernd had suggested.
http://web.archive.org/web/20120127150224/http://dialog.datalist.org/scripts/ScriptreplaceUmlaut.html

But it doesn't work if you still see the special characters I'm pasting
below from https://www.studying-in-germany.org/german-umlauts/ 

   This is a test of OnBeforeSendingMessage with ä, ö, ü

program OnBeforeSendingMessage;

function StringReplace(S, OldPattern, NewPattern: string): string;
var
  SearchStr, Patt, NewStr: string;
  Offset: Integer;
begin
  SearchStr := S;
  Patt := OldPattern;
  NewStr := S;
  Result := '';
  while SearchStr <> '' do
  begin
    Offset := AnsiPos(Patt, SearchStr);
    if Offset = 0 then
    begin
      Result := Result + NewStr;
      Break;
    end;
    Result := Result + Copy(NewStr, 1, Offset - 1) + NewPattern;
    NewStr := Copy(NewStr, Offset + Length(OldPattern), 2147483647);
    SearchStr := Copy(SearchStr, Offset + Length(Patt), 2147483647);
  end;
end;

function OnBeforeSending(var Message: TStringlist; Servername: string;
IsEmail: boolean):boolean;
var s:string;
begin
result:=true;
s:=message.text;
s:=StringReplace(s,'ü','ue');
s:=stringreplace(s,'ö','oe');
s:=stringreplace(s,'ä','ae');
s:=stringreplace(s,'Ü','Ue');
s:=stringreplace(s,'Ö','Oe');
s:=stringreplace(s,'Ä','Ae');
s:=stringreplace(s,'ß','ss');
message.text:=s;
end;

begin
end.
Technical Details
Message-ID: <rud3db$ggn$1@solani.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <ru5nfg$si7$1@solani.org> <3xo0b6k69bco$.dlg@v.nguard.lh> <ruagkd$j08$1@solani.org> <1gf2aqovcfhb8.dlg@v.nguard.lh> <rubuok$j1b$1@solani.org> <1rx0buxcp5q2y$.dlg@v.nguard.lh>

Show Full Headers
Complete Article Headers
Message-ID: <rud3db$ggn$1@solani.org>
Subject: Re: [40tude] Edit -> Find regular expression?
Date: Fri, 22 Jan 2021 05:10:27 +0530
From: mike <this@address.is.invalid>
References: <ru5nfg$si7$1@solani.org> <3xo0b6k69bco$.dlg@v.nguard.lh> <ruagkd$j08$1@solani.org> <1gf2aqovcfhb8.dlg@v.nguard.lh> <rubuok$j1b$1@solani.org> <1rx0buxcp5q2y$.dlg@v.nguard.lh>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
X-Received-Bytes: 3177
Content-Type: text/plain; charset="iso-8859-1"
X-User-Id: eJwNyEkBwDAIBEBLBZZLTiDgX0I6z1ExsnaYGnR141CZSHuBIAgm8YhhY5pKzp1/tdPDei62cfwm8yeLraUHKpgU4Q==
Injection-Date: Thu, 21 Jan 2021 23:40:28 -0000 (UTC)
Cancel-Lock: sha1:v5DjbTCW/rIWSbKljmImNneC7D0=
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: solani.org; logging-data="16919"; mail-complaints-to="abuse@news.solani.org"
User-Agent: 40tude_Dialog/2.0.15.41
Newsgroups: news.software.readers