Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rafaelbernard
Created June 16, 2011 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelbernard/1029899 to your computer and use it in GitHub Desktop.
Save rafaelbernard/1029899 to your computer and use it in GitHub Desktop.
Substitui caracteres win1252 por UTF-8
-- DROP FUNCTION substitui_win1252(texto);
CREATE OR REPLACE FUNCTION substitui_win1252(texto text)
RETURNS text AS
$$
BEGIN
texto := replace(replace(replace(replace(replace(texto, '’', ''''), '“', '"'), '”', '"'), '•','•'), '–', '-')::text;
RETURN texto;
END;
$$
LANGUAGE plpgsql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment