Skip to content

Instantly share code, notes, and snippets.

@rafaelbernard
Created June 16, 2011 18:23
Show Gist options
  • Save rafaelbernard/1029869 to your computer and use it in GitHub Desktop.
Save rafaelbernard/1029869 to your computer and use it in GitHub Desktop.
substitui_win1252_html
-- DROP FUNCTION substitui_win1252_html(texto);
CREATE OR REPLACE FUNCTION substitui_win1252_html(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