mapsedge: Me at Stone Bridge Coffee House (Titanic)
[personal profile] mapsedge
Is there a regular expression that would allow me to replace any character above ASCII-128 in a string with the HTML entity equiv, an in:

replace in {string}:  ascii-X with &#X; where X between 128 and 255

It would save a nested loop if I could figure out how to do it in one statement.

Date: 2008-08-14 16:02 (UTC)
From: [identity profile] joegoda.livejournal.com
Here's where I show my ignorance... but are you looking for something like this?

ascii_to_entities(str [string])

Converts ASCII to Entities

Class: Regex (REGX)

Description: Returns str after converting higher ASCII values into HTML entities where possible. Only use when the auto_convert_high_ascii config file preference is set to yes (i.e. $PREFS->ini('auto_convert_high_ascii') == 'y').

June 2023

S M T W T F S
    123
45678910
11121314151617
1819 2021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 28th, 2026 05:50
Powered by Dreamwidth Studios