Question

I have a URL that I want to redirect however, I can't seem to enter the character into vim.

The character is ¬ (Logical Negation) and I want to redirect it to ~ (Tilde).

Redirect permanent /¬foo http://www.example.com/~foo

Vim won't let me copy this character into the terminal and I don't have it in my keyboard!

Was it helpful?

Solution

Here is more information about your wild character:

http://www.theasciicode.com.ar/extended-ascii-code/logical-negation-symbol-ascii-code-170.html

Install yudit, It is a unicode editor, you might be able to insert it easier with that.

In mathamatics speak, The statement ¬A is true if and only if A is false.

http://en.wikipedia.org/wiki/Negation

You may have to set your encoding preferences in vi as explained here:

Vim and ASCII extended characters?

How to add Logical Negation character to VI:

In VI, go into insert mode. While in INSERT mode press:

Ctrl-v 172

Where 172 is the character code representing the character you want. This assumes you are using the default encoding ISO 8859-1.

You may be wondering why the logical not is 170 in extended ASCII but in VI you gotta type 172 to get that character? Because you are using ISO 8859-1:

http://www.htmlhelp.com/reference/charset/iso160-191.html

I am highly skeptical that Apache is going to do what you want

You're probably going to be a lot more clever than you already are to pull it off. Your Logical Not character is going to be re-encoded between the client's browser and the Apache server.

http://www.packetizer.com/labs/cs/characters.cgi?text=%C2%AC&submit=Submit

OTHER TIPS

That's a non-ASCII character, so the URI that a browser would send to your server if a user requested /¬foo should be /%C2%ACfoo (with the ¬ character encoded as UTF-8 and each byte of the UTF-8 then URI encoded) or possibly just /%ACfoo (if the browser doesn't do the UTF-8 conversion first). Try configuring a redirect for the encoded form(s) instead of the raw form.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top