Adobe Dreamweaver Forums



Last 10 THreads :         Rate My Site Please (Last Post : malcster2 - Replies : 3 - Views : 4 )           »          WebHelp Compile Won't Display (Last Post : Colum McAndrew - Replies : 20 - Views : 21 )           »          Placing an image in each column in ColumnChart (Last Post : SujitG - Replies : 1 - Views : 2 )           »          AdvancedDataGrid Select All Rows (Last Post : Milo[HUN] - Replies : 1 - Views : 35 )           »          rollover problem in Gallery button (Last Post : johndalejkx1 - Replies : 0 - Views : 1 )           »          x and y into Latitude and longitdue (Last Post : Ayush.Jain - Replies : 10 - Views : 11 )           »          Site Map problem (Last Post : Kcheval - Replies : 0 - Views : 1 )           »          Image icons disappear when CPD is deleted (Last Post : Peter Grainge - Replies : 1 - Views : 2 )           »          FMS3 Linux and virtual host (Last Post : RussianMedved - Replies : 0 - Views : 1 )           »          Flash Media Server 2.0 (Last Post : Ajay P - Replies : 3 - Views : 13 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags: ,



Reply
  #1 (permalink)  
Old 07-23-2008, 05:17 PM
dynason
 
Posts: n/a
Diggs:
Default utf-8 to hexadecimal

I have a online form which require user to input text (which may contains asian
language). the charset of the application is utf-8

How could we convert the received text into their hexadecimal values?

pls kindly advise



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2008, 06:57 PM
cf.marc
 
Posts: n/a
Diggs:
Default Re: utf-8 to hexadecimal

<cfif structKeyExists(form,"asian_string")>
<cfset strLen = len(form['asian_string'])>
<cfset hex = arrayNew(1)>

<cfloop from="1" to="#strLen#" index="i">
<cfset current_char = mid(form['asian_string'],i,1)>
<cfset arrayAppend(hex,formatBaseN(asc(current_char),16)) >
</cfloop>

<cfdump var="#hex#">
</cfif>

<form action="" method="post">
<input type="text" name="asian_string" />
<input type="submit" />
</form>

Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 06:58 AM
dynason
 
Posts: n/a
Diggs:
Default Re: utf-8 to hexadecimal

Thank you very much.

Pls kindly also advise how to convert hex back to utf8.
Reply With Quote


  #4 (permalink)  
Old 07-24-2008, 06:58 AM
Daverms
 
Posts: n/a
Diggs:
Default Re: utf-8 to hexadecimal

Hi,

You can try this UDF.

http://cflib.org/udf/hexToString
Reply With Quote
  #5 (permalink)  
Old 07-24-2008, 06:58 AM
PaulH **AdobeCommunityExpert**
 
Posts: n/a
Diggs:
Default Re: utf-8 to hexadecimal

dynason wrote:
> How could we convert the received text into their hexadecimal values?


why?
Reply With Quote
  #6 (permalink)  
Old 07-25-2008, 12:11 PM
dynason
 
Posts: n/a
Diggs:
Default Re: utf-8 to hexadecimal

I have tried hexToString function but does not display characters correctly.

For example, I used the code from cf.marc to convert an Asian character to hex
(value is 4e2d).

After using hexToString, the character is not correctly.

Pls kindly advise.

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:54 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk