-
To let you know I am creating a text editor for perl and if you save the text using standard way of doing it the text is saved in a strange format. All the line feeds are converted into these little squares..(no idea what there called)but anyways I want to be able to save the textbox in ANSI format like how http://www.textpad.com lets you save it in ANSI format. Thats what I use right now but I want to have the specialized features of my program to do it. So anyways as I was saying I want the text to be saved in ANSI format. I'm sure this is not to hard. If anyone can help I would appreciate it.
-
Try this:
Code:
Dim sText As String
Dim nFreeF As Integer
sText = Text1.Text
nFreeF = FreeFile
Open MyFile$ For Output As nFreeF
Print #nFreeF, sText
Close
I didn't test it yet, but I think it should work.
-
It's nothing to do with ASCII or Unicode problems.
Under POSIX systems, lines are terminated with an "\n". Windows and DOS use "\r\n". So, when Windows encounters the POSIX style of line termination, it doesn't know what to do, so it puts a square up. Simply terminate your lines with vbCrLf to let it work on Windows. However, Perl scrips will usually run on some POSIX-based server, so it is best to have the option to save with only "\n", so that they work properly.
-
Well I have been doing some testing and it seems that I can everythign works fine in vb. The reason I asked this is because if you save a cgi script in notepad and reopen it the cgi script is corrupt to a perl engine. It wont even read it. But it seems in visual basic saving the text in something like the above example works fine. Havent tested it a perl engine can read it tho but I see no reason why it cant right now. No visible corruption..
-
When I write perl scripts and send them off to my UNIX based server I need to run a FIX command and then a CHMOD 775 to the file
-
Yes, the FIX command rewrites the line endings.