Server.Coldfusion.SupportedLocales includes unsupported locales

Description

Lucee 5.2.5 crashes with unsupported Locale [sr_BA_#Latn] on line 8
Lucee 4.5 crashes with unsupported Locale [ja_JP_JP_#u_ca_japanese] on line 8
acf supports all advertised locales

https://trycf.com/gist/2150f3bfcb9b705b03a850b59dfa1c43/acf2016?theme=monokai

Environment

None

Activity

Zac Spitzer 
9 December 2022 at 08:50

round tripping lsParseDateTime( lsDateTimeFormat(testDate)); only works with a few locales

Andreas R 
16 September 2020 at 10:20
(edited)

I came accross this issue during experimentations and would like to complement some additional informations.

  • The locales sr_BA_#Latn, sr_ME_#Latn, sr_RS_#Latn, ja_JP_JP_#u-ca-japanese, th_TH_TH_#u-nu-thai are Java Locales IDs. The locales given by server.Coldfusion.SupportedLocales are all English Locales DisplayNames from the underlying Java, with the exception of these 5 mentioned above (which are Locale IDs. Why? Maybe the corresponding displaynames had “,” and this would break the list server.Coldfusion.SupportedLocales?

  • Because Lucee’s cfml setLocales() can have the Java DisplayName OR Java LocaleID passed as an argument, you can set them with it’s corresponding English DisplayNames as workaround/alternative.

That means that the issue could possibly be resolved by populating server.Coldfusion.SupportedLocales with all English DisplayNames of the Java Locales. For better illustration/proof run simple test template below testSetLocales.cfm. It outputs data with setting server.Coldfusion.SupportedLocales and java.util.Locales.getAvailableLocales() with DisplayName as proof.

If it comes to compability with ACF: ACF accepts ALL Locale IDs of Java.util.Locale.getAvailableLocales() and only a small set of DisplayNames. Lucee accepts all from both with exception of the 5 issued above. Thus it would be even better for compability reasons to make these work and then populate server.Coldfusion.SupportedLocaleswith Locale IDs and DisplayNames alltogether in Lucee.



for demonstration testSetLocales.cfm

Pothys - MitrahSoft 
20 November 2017 at 14:51

I've added test case for this ticket, Lucee doesn't supports for following locales from #Server.Coldfusion.SupportedLocales#.

In below three locales were working fine while removed '#'

Pull Request: https://github.com/lucee/Lucee/pull/341

Michael Offner 
18 November 2017 at 01:26

can you please make a testcase for this?

Pothys - MitrahSoft 
9 October 2017 at 14:19

I've analyzed this ticket & confirmed the issue happened on latest version of lucee. We can able to setLocale from the server.coldfusion.SupportedLocales.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 6 October 2017 at 10:33
Updated 9 December 2022 at 08:50