Is a lumbar puncture to test for encephalitis safe?

Yes. A person with symptoms of encephalitis (inflammation, swelling in the brain) or meningitis (inflammation, infection of the fluid and membranes covering the brain & spinal cord) has a serious illness that can cause permanent brain damage or death. A lumbar puncture is safe because it is not a risky test, and because the bad effects of the diseases are so much worse than the little risks of an l.P..
Yes. Of course it needs to be done with absolute sterility by a competent physician but is essential to obtain a diagnosis to guide proper treatment.