FILE_WRITE strings w/ =
vining
Posts: 4,368
in AMX Hardware
Has anyone noticed that if you write to file and the string contains a equal sign ( = , decimal 61) the equal will print but the next 2 characters don't and then the remaining characters shift left in their place.
I can live w/o using = or I could pad them w/ extra spaces after each occurrence as sacrificial characters but I'd rather not?
Does anyone know why this happens?
I can live w/o using = or I could pad them w/ extra spaces after each occurrence as sacrificial characters but I'd rather not?
Does anyone know why this happens?
0
Comments
This is from the file attached in my nightly SitRep email:
You can see that everywhere I have an equal sign the next two characters that follows are missing. In some cases the = sign disappeared too!
Now if I FTP into the master and open the file directly everything is written correctly. Obviously last night when I thought the problem went away I was checking the file directly on the master and not forcing a "send email".
= T turned into = since the code wasn't valid. =00 disappeared since it turned into a null. =12 turned into unicode character 12 (at least, that's what my browser shows: a little box with 00 12 in it)
The question is which part of the mail flow actually did the misinterpreting -- is it your AMX code labeling the attachment incorrectly as MIME encoded rather than plain text? Or an intervening mail server reformatting the attachment as if it was MIME encoded? Or your mail client showing you the attachment assuming it was MIME encoded?
The way to escape an equals sign for ASCII encoding should be obvious -- =3D. Unfortunately, this makes your on-disk version of the file less readable.
Jeremy
It's easier to live with the MIME and the advantages it offers than for me to spend the time to figure out a work around.
The lines going into the log go through a clean ascii function anyway so I simply modified it to also replace any = signs it finds with a - instead.
At least I know what the problem is now, thanks for the response!