Unrecognized character \xCA

jonasbn on 2004-02-10T10:55:12

I have lived with this issue for a VERY long time, now it is time to do something about it.

When I program Perl and I type || in BBEdit I get the following error when compiling:

Unrecognized character \xCA

If somebody knows what the problem is, I am very interested


Well...

bart on 2004-02-10T12:45:59

Apparently, "\xCA" is a non-breaking space on the Mac — the same as "\xA0" on Windows and in ISO-Latin-1, and " " in HTML.

So why wouyld BBEdit replace a normal space with a non-breaking space? It doesn't quite add up.

Re:Well...

jonasbn on 2004-02-10T14:33:09

It seems the alt + space combination inserts this character, so writing code like:

open(FIN "<$file") || die "Unable ...

Triggers this often, resulting in compilation error :-/

Re:Well...

vsergu on 2004-02-12T20:26:15

So just get into the habit of writing

open FIN, "<$file" or die "Unable ...";

instead.

Re:Well...

jonasbn on 2004-02-13T07:25:09

hehehe... you are right, I should, I used to write or I cannot remember why I went back to ||

Silly me

Solution

malte on 2004-02-10T13:07:55

Alt-Gr (German Layout) + 7 is the vertical line. Alt-Gr + Space is that character. ||Boom!

Re:Solution

jonasbn on 2004-02-10T13:29:49

On my Powerbook with danish keyboard the | is located on i and is activated using it in combination with alt. So it is simply because of speedy typing and unfortunately it does not show up in the editor.

thanks for the response pin-pointing the problem :)

Now I will look into a solution/workaround to the problem.

Re:Solution

nicholas on 2004-02-10T14:53:48

use emacs? :-)

(Or is emacs just a solution still searching for its problem?)

Re:Solution

jonasbn on 2004-02-11T08:44:32

Apparantly BBEdit has a flag where you can indicate so you can see 'invisible' characters.

Invisible characters in a text editor?

This seems to do the job, the only problem now is that have indicators of tabs and newlines aswell (looks like an old version of Wordperfect).

But I'll survive

Re:Solution

warming on 2004-02-11T15:13:41

perl -pi -e 's/\xCA//g' filename

Usually does the trick. :)