I am in the process of migrating our CMS application to use UTF-8 as
the default charset when writing files using CFFILE. In order for the
migration to work and not break existing files I need to find out the
default charset of the JVM. I talked to a couple different people and
was told to use java.nio.charset.Charset.displayName() but I can't get
the code to work to save my life. Do I need to upgrade the JVM or
install some kind of JDK in order for this to work?

<cfset variables.Obj.Locale = createObject("java","java.util.Locale")>
<cfset variables.Obj.Charset = createObject("java","java.nio.charset.Charset")>
<cfset variables.DefaultLocale = ToString(Variables.Obj.Locale.getDefault())>
<cfset variables.DefaultCharset = Variables.Obj.Charset.displayName()>

<cfoutput>
Default Locale: #Variables.DefaultLocale#<br>
Default Charset: #Variables.DefaultCharset#
</cfoutput>


Thanks,

John Blayter
email: [EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226203
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to