You can also use a variable resistor for one of the resistors and adjust the resistance as required.
For example, you can use a 2.2kΩ and 1.57kΩ resistor. Use a 1.2kΩ resistor in series with a 500Ω resistor instead of the 1.57kΩ resistor. Or you can even use a 2kΩ (or thereabouts) variable resistor and adjust its resistance.
Another example. It has been mentioned above by BradtheRad that 1.4kΩ and 1kΩ can be used. So, you can use a 1kΩ resistor in series with a 500Ω variable resistor. You could also use a 2kΩ resistor and adjust its resistance.
Using a variable resistor will allow you to compensate for errors in resistance for both resistors.
Ok I have experienced a problem. What I forgot to mention was that the 12V output is coming from an "open drain output". Its acting funny. The voltage divider works fine but when I connect my sensor to the CPU using a rs232 I get a constant 5 V output. When I disconnect the RS232 my output resumes to 5 V square wave.
So firstly im not sure why that is happening. Also please suggest me a way to drop 12v square wave from open drain output to 5v square wave to feed it to a PIC pin.