Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:58:39+00:00 2026-06-10T09:58:39+00:00

I have just set about the task of stripping out HTML entities from our

  • 0

I have just set about the task of stripping out HTML entities from our database, as we do a lot of crawling and some of the crawlers didn’t do this at input time 🙁

So I started writing a bunch of queries that look like;

UPDATE nodes SET name=regexp_replace(name, 'à', 'à', 'g') WHERE name LIKE '%#xe0%';
UPDATE nodes SET name=regexp_replace(name, 'á', 'á', 'g') WHERE name LIKE '%#xe1%';
UPDATE nodes SET name=regexp_replace(name, 'â', 'â', 'g') WHERE name LIKE '%#xe2%';

Which is clearly a pretty naive approach. I’ve been trying to figure out if there is something clever I can do with the decode function; maybe grabbing the html entity by regex like /&#x(..);/, then passing just the %1 part to the ascii decoder, and reconstructing the string…or something…

Shall I just press on with the queries? There will probably only be 40 or so of them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:58:40+00:00Added an answer on June 10, 2026 at 9:58 am

    Write a function using pl/perlu and use this module https://metacpan.org/pod/HTML::Entities

    Of course you need to have perl installed and pl/perl available.

    1)
    First of all create the procedural language pl/perlu:

    CREATE EXTENSION plperlu;
    

    2) Then create a function like this:

    CREATE FUNCTION decode_html_entities(text) RETURNS TEXT AS $$
        use HTML::Entities;
        return decode_entities($_[0]);
    $$ LANGUAGE plperlu;
    

    3) Then you can use it like this:

    select decode_html_entities('aaabbb&.... asasdasdasd …');
       decode_html_entities    
    ---------------------------
     aaabbb&.... asasdasdasd …
    (1 row)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large set of documents in a CouchDB database that were just
I have just set up ruby in Aptana studio and am getting the following
So i have just set new Error Handlers in httpd.conf for custom error pages:
I'm fairly new to WebService developement and have just set up my own webservice
I have just added a google translate in website.And set the default language English.
I have a CRON job php script that I just set up not too
If I have a table of a hundred users normally I would just set
Could I use migrator.net bare migration framework and just have a set of SQL
I have a <Grid> set up just the way I want with each cell
I have a set of relatively simple electrical circuits. Small ones involving just resistors,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.