Author Topic: ÿ character causes a syntax error  (Read 1880 times)

This has bugged me for a while now. The ÿ character, or \xFF, causes a syntax error if put into code as its raw form.
It's fine if you have a pre-existing ÿ character and manipulate it via string functions, but actually having one in code causes the compiler to say there's a syntax error.

Does anyone know why this happens?

I wonder ÿ it would do that.


Where in the code? If it's in a string, just replace it with \xFF. Though that still shouldn't be causing a syntax error. What encoding did you save the file with?

Could be a bug in the parser maybe? It probably just wasn't designed to handle that character.


-snip-

this is awesome

That is weird.

Okay, with some further poking around, it only causes a syntax error if in or adjacent to a string. So, for example, echo("Test" ÿ); will cause a syntax error while echo("Test", 3ÿ); will not.

It does, however, cause a syntax error if it's in a code word, or in other certain places: funcÿtion test(){} and function test()ÿ{} are both syntax errors while functionÿ test(){}, function testÿ(){}, function ÿtest(){}, and function test(){}ÿ are not. They also all do the same thing.

I'm simply confused on why you've found a need to use the ÿ character at all. I'm pretty sure this is the first time in my life I've ever used the ÿ character. If you were using it because it's 0xFF that'd make more sense, but I'm still at a loss.

I'm simply confused on why you've found a need to use the ÿ character at all. I'm pretty sure this is the first time in my life I've ever used the ÿ character. If you were using it because it's 0xFF that'd make more sense, but I'm still at a loss.

%asciiMap = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„… ‡ˆ‰ ‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß áâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ\xFF";


Originally the \xFF was just ÿ.

I assume you're using that for character matching. Since ÿ seems to be unsupported anyway, leaving it out of the map seems perfectly acceptable since it's the last one anyway. If you were really brown town you could also just add an exception for if it's not found, it's ÿ.

Since ÿ seems to be unsupported anyway


...as its raw form. It's fine if you have a pre-existing ÿ character and manipulate it via string functions...