Jump to content

T_CONSTANT_ENCAPSED_STRING


iwato

Recommended Posts

I wondered if that was it. I often have this problem when I copy and paste from websites. Usually the problem characters appear at line breaks. I simply delete all line breaks by hand and hit the return key to add a correct line break. It is painstaking, but usually works.I suppose you could automate the process.

Link to comment
Share on other sites

I suppose you could automate the process.
I finally received a response from MAMP Pro. Perhaps it was because I sent an email in German to the support team's German address and asked for a telephone number. They believe that the problem had to do with blank characters. They still have responded to my query about permissions . . . .Are there PHP functions that could eliminate hidden characters in a document?Roddy
Link to comment
Share on other sites

Don't think so. preg_replace() with a custom regex might do it.
The problem with performing a replace is that I do not know what I would be replacing, as I cannot see it.Roddy
Link to comment
Share on other sites

Look up the function. The examples or some of the user comments (like this one will show you how to use hex values for the control characters. Some control characters have escape versions, like \r corresponds to a carriage return, which is probably the one giving you all the trouble anyway.

Link to comment
Share on other sites

Look up the function. The examples or some of the user comments (like this one will show you how to use hex values for the control characters. Some control characters have escape versions, like \r corresponds to a carriage return, which is probably the one giving you all the trouble anyway.
Are you familiar with something called auto_detect_line_endings? Would it not be appropriate in this context?Roddy
Link to comment
Share on other sites

I'm not certain, but I think the problem occurs when EOL characters get out of sequence, or if an extra one gets added. Here's the way they are supposed to workLF: Unix family et al.CR + LF: DOS, Windows et al.CR: Macintosh et al.When these combinations get pasted correctly, I think all is well. I think this because the problem does not occur regularly.But what happens if something goofs and you get LF + CR or even LF + CR + LF ? I suspect you will get an orphaned LF in there that messes things up.It is also possible that TextEdit explodes when it gets a DOS-formatted EOL. TE is no longer a pure text editor, and plain text is not its default mode. I'm a Mac guy for 18 years now, but I never use TE for code because I have had weird experiences.Have you tried TextWrangler? It's a free version of BBEdit, and as a plus it lets you see invisible files, which is handy if you want to tweak your Unix config files from the Mac interface.

Link to comment
Share on other sites

Have you tried TextWrangler? It's a free version of BBEdit, and as a plus it lets you see invisible files, which is handy if you want to tweak your Unix config files from the Mac interface.
It is time to wrangle. Many thanks!Roddy
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...