Entries Tagged as "CFML"

Railo Log analyzer bugfix update: v2.2.0

For anyone using the Railo log analyzer, there is an update out!

Update 2.2.0 contains:

  • Added View option, to view the log file inline in the admin.
  • Fixed a bug with Railo 4.0.x, which prevented the display of log files. Reason: cfdirectory filter attribute doesn't respect pipe character as delimiter anymore.
  • Updated the styling, so tables and other layout looks normal again.

Check the Log analyzer page for more details, or go to the Railo extension store.

 

No Comments

Decoding a \unicode-escaped string in CFML

I needed to incorporate a news feed from yammer.com, which was pretty easy using their API. The return format is JSON, so all looked great. Except for the "rich text" they sent back:

Unicode escapes example cfdump

As you can see, there are a lot of "\u00.." occurences in the rich text. I searched Google for a standard CFML solution to convert these character sequences, but found nothing for CFML. So I wrote the following function, which tries to convert the string as fast as possible:

<cffunction name="unicodeEscape" returntype="string" output="no">
<cfargument name="s" type="string"/>
<!--- If no unicode-escapes present in the string: return --->
<cfif not find('\u', arguments.s)>
<cfreturn arguments.s />
</cfif>
<!--- If % is present in the string: url-encode it. Otherwise, urlDecode would choke on it --->
<cfif find('%', arguments.s)>
<cfset arguments.s = replace(arguments.s, '%', urlEncodedFormat('%'), 'all') />
</cfif>
<!--- Ascii characters (\u0000 - \u00FF) can be translated as %00-%FF --->
<cfset arguments.s = replace(arguments.s, "\u00", "%", "all") />
<!--- Higher characters (\u0100 - \uFFFF) can be translated as %01%00 - %FF%FF.
Only do this regex if there is something to replace. --->
<cfif find('\u', arguments.s)>
<cfset arguments.s = rereplace(arguments.s, "\u([0-9A-F][0-9A-F])([0-9A-F][0-9A-F])", "%\1%\2", "all") />
</cfif>
<cfreturn urldecode(arguments.s) />
</cffunction>

If there is a built-in way in CFML to decode unicode-escapes, then please leave a comment. I'd be happy to learn :)

2 Comments

Dutch CFUG networking event on March 22, 2013

I recently joined the CFUG-NL team, which had been a bit silent for the last few years. To start off, and hear about your ideas for upcoming CFUG meetings, we would like to invite you all to a networking event on March 22, 2013 in Utrecht.

Please see www.cfugnl.nl for full details, and don't forget to register. See you at Cafe Olivier!

 

No Comments

How to upgrade from Railo 3.* to Railo 4

Upgrading your existing Railo 3 installation to Railo 4 is really easy! No need to re-install Railo or anything, just copy-paste some jar files...

No Comments

My view on CFCamp 2012

I did my first conference presentation here at CFcamp 2012. It worked out great, and got some good feedback. I actually can't wait to do another one! Hopefully, you'll be hearing from me at CF.Objective() or Scotch on the Rocks (June 2013!) soon.

So, CFcamp. It is not a German conference. It is a very international one, with speakers from France, Germany, America, Scotland, Switzerland, Belgium, England, etcetera. All presentations were in English, flyers and programs in English, so easily accessible for a Dutchie like me.

The venue was the StadtHalle Germering,

No Comments

sostenuto