[thelist] character set word -> ascii

m u i n a r muinar at gmx.net
Thu Mar 7 11:05:00 CST 2002


Thanks Eric. Didn't think about a regexp. Sounds promising.
Only thing is... if it replaces the line breaks, or the
'Umlauts' (ä, ö, ü) with a blank space, it wouldn't look
much more legible. AFAIK ä, ö and ü aren't a problem with
email normally (as you can see in this email here), but in
the example below they are scrambled anyway:

______________________________________________________________________

Der Meister sagt: "Wenn wir ahnen, dass die Zeit f=FCr eine =0D
Ver=E4nderung gekommen ist, beginnen wir unbewusst, all unsere =0D
Niederlagen bis zu diesem Augenblick wie auf einem Video =0D
vorbeiziehen zu lassen. Je =E4lter wir werden, desto gr=F6sser wird =0D
nat=FCrlich die Anzahl der Niederlagen. Doch mit ihnen ist auch =0D
______________________________________________________________________


What confuses me: The HMTL form itself has inserted the line breaks.
I used wrap="hard" for this in the text area. The newsletter is then
stored in the database and retrieved from there by another file,
which sends the newsletter out. This file has a preview, and in this
preview everything looked perfect!

Maybe the headers are the problem? I have:

          . "MIME-Version: 1.0\n"
          . "Content-Type: text/plain; charset='iso-8859-1'\n"
          . "Content-Transfer-Encoding: 7bit\n"

Thanks again for *any* hints.

Mike


At 08:47 07.03.02 -0500, you wrote:

>I would suggest using a regular expression to remove all bad characters:
>
>$this_variable = ereg_replace("[^\x20-\x7E]", "", $original_string);
>
>this will look for any character that has an ascii value not between 32
>(x20) and 126 (7E) this covers all standard punctuation, letters, numbers,
>etc.  (check out http://www.asciitable.com for a list of characters)... it
>then replaces the bad characters with a blank string.




More information about the thelist mailing list