Removing Binary Characters

Find, replace, find in files, replace in files, regular expressions

Removing Binary Characters

Postby espalmer2 » Wed Feb 15, 2006 8:46 pm

I'm using a program that converts an xml to an html using a customized stylesheet. The html then has binary characters at the very top of the file. I can only see these characters when I open the file using VI on solaris. If I open the file using VI on linux then I don't see the characters. If I open the file with UltraEdit 32 with the default settings I don't see the characters.

These are the characters I see when I open the file on solaris: \377\376 (I attached an example to this post)

When I remove these characters the html functions properly.

Is there a way to remove these characters using UltraEdit-32? I have version 11.20b.

Thanks,
Sam
User avatar
espalmer2
Newbie
 
Posts: 2
Joined: Wed Feb 15, 2006 12:00 am

Re: Removing Binary Characters

Postby Bego » Thu Feb 16, 2006 7:09 am

Maybe its a UTF-8 unicode BOM "problem"

look there: viewtopic.php?t=2614

rds Bego
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: Removing Binary Characters

Postby espalmer2 » Mon Feb 20, 2006 8:11 pm

i have my problem figured out now. i would like to thank Bego and the people from ultraedit who always respond very quickly.

this is what i have figured out...

for some reason when i copy the html file through secure shell to a solaris box then copy it back to windows the file becomes corrupt when viewed in a browser. the file doesn't become corrupt when the copying is done from windows to linux.

with much help i found some cures to my problem:

-on solaris or linux:
tr -cd '\11\12\40-\176' < $INPUT_FILE > $OUTPUT_FILE

-on windows with ultraedit 32 (version 11.20b)
i've found two different methods:
1. open file in UE32 before it is secure copied to solaris then click file > conversions > unicode to ascii > save
2. if you have already secure copied the file from solaris back to windows then method 1 will not work, try: open the file with UE32 > edit > hex functions > hex edit > delete binary characters at beginning of file > also, while still in hex edit mode, you need to find/replace all "00" with nothing.

-sam
User avatar
espalmer2
Newbie
 
Posts: 2
Joined: Wed Feb 15, 2006 12:00 am


Return to Find/Replace/Regular Expressions

cron