An optical fiber polarizer is constructed with a fiber Bragg grating (FBG) based on birefringence effects induced by a transverse force applied to a section of the grating. In this work we present the principle of operation and experimental results of this device. We show how this fiber polarizer can be used in transmission mode if the affected region of the grating is about one percent of the grating length. When the affected region of the grating is equal to or greater than 10 percent, the grating is a good candidate as polarizer in reflection mode, in a configuration completely different from the first one. Both configurations can be spectrally tuned according to the applied force and/or pressed region along the grating.