Skip to main content
Participant
September 23, 2009
Question

Convert HEX to a readable format

  • September 23, 2009
  • 1 reply
  • 697 views

I have a hex file that I am trying to figure out how to convert it to a readable format....any help would be great

Thanks,

Nick

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    September 26, 2009

    Suppose the hex text is stored as myHexFile.txt. Then you could proceed like this

    <cffile action="read" file="C:\Coldfusion8\wwwroot\test\myHexFile.txt" variable="myHex">

    <cfset myBinary=binaryDecode(myHex,"hex")>
    <cfset myString = charsetEncode(myBinary,"utf-8")>

    <!--- Alternative --->

    <!--- <cfset myString = toString(toBinary(toBase64(myBinary,"UTF-8")))>--->


    <cfoutput>#myString#</cfoutput>