Leo_CF wrote:
> SetLocale() is ignored when a CFC is called through an
event gateway.
> SetLocale() works fine when called through an ordinary
HTTP request. When
> called through the gateway the locale is always set as
default locale that the
> server JVM instance was installed with.
ok, i can confirm for asynch gateways.
> Does anybody have a workaround for this?
not sure i'd class this as a "workaround" as it's pretty
drastic & i have not
tested for any side effects but this "works":
<cfscript>
locale=createObject("java","java.util.Locale");
thisLocale=locale.init("th","TH");
originalLocale=locale.getDefault();
locale.setDefault(thisLocale);
</cfscript>
<!--- note that cflog doesn't do unicode --->
<cflog text="#getLocale()# :::
#LSdateFormat(now(),'FULL')#" file="localeTest">
<cfscript>
// return to original locale
locale.setDefault(originalLocale);
</cfscript>