Publisher review:Encode-ZapCP1252 module performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations. This module performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations.< into app you ever been processing a Web form submit, assuming that the incoming text was encoded in ISO-8859-1 (Latin-1), only to end up with a bunch of junk because someone pasted in content from Microsoft Word? Well, this is because Microsoft uses a superset of the Latin-1 encoding called "Windows Western" or "CP1252". So mostly things will come out right, but a few things--like curly quotes, m-dashes, elipses, and the like--will not. The differences are well-known; you see a nice chart at documenting the differences on Wikipedia: .
Of course, that won't really help you. What will help you is to quit using Latin-1 and switch to UTF-8. Then you can just convert from CP1252 to UTF-8 without losing a thing, just like this: use Encode; $text = decode('cp1252', $text, 1);But I know that there are those of you out there stuck with Latin-1 and who don't want any junk charactrs from Word users, and that's where this module comes in. It will zap those CP1252 gremlins for you, turning them into their appropriate UTF-8 approximations.
Usage
This module exports a single subroutine: "zap_cp1252()". You use it like this zap_cp1252($text); This subroutine performs an *in place* conversion of the CP1252 gremlins into appropriate ASCII approximations.
Note that because the conversion happens in place, the data to be converted *cannot* be a string constant; it must be a scalar variable.
Encode-ZapCP1252 0.01 is a Perl script for Modules scripts design by David Wheeler.
It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.
Operating system:Windows / Linux / Mac OS / BSD / Solaris