Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-2069

Locale support for arraySort()

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.0.013
    • Fix Version/s: 4.1.0.000, 4.0.1.002
    • Labels:
      None

      Description

      G'day
      Hey, is there any move afoot to add locale support to arraySort()? CF added it for CF10, and it's kind of essential behaviour, I think (that said, I've never needed it in production code, so not like that essential, I guess . Still: any functionality that deals with text should be savvy to locales.

      Here's some sample code demonstrating CF's functionality:

      <cfprocessingdirective pageencoding="UTF-8">
      <table><tr>
      <cfscript>
      a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","é","à","è","ù","â","ê","î","ô","û","ë","ï","ü","ÿ","ç"];
      arraySort(a, "text", "asc", false);
      writeOutput("<td>");
      writeDump(a);
      writeOutput("</td>");

      arraySort(a, "text", "asc", true);
      writeOutput("<td>");
      writeDump(a);
      writeOutput("</td>");
      </cfscript>
      </tr></table>

      And the output:

      array
      1 a
      2 b
      3 c
      4 d
      5 e
      6 f
      7 g
      8 h
      9 i
      10 j
      11 k
      12 l
      13 m
      14 n
      15 o
      16 p
      17 q
      18 r
      19 s
      20 t
      21 u
      22 v
      23 w
      24 x
      25 y
      26 z
      27 à
      28 â
      29 ç
      30 è
      31 é
      32 ê
      33 ë
      34 î
      35 ï
      36 ô
      37 ù
      38 û
      39 ü
      40 ÿ

      array
      1 a
      2 à
      3 â
      4 b
      5 c
      6 ç
      7 d
      8 e
      9 é
      10 è
      11 ê
      12 ë
      13 f
      14 g
      15 h
      16 i
      17 î
      18 ï
      19 j
      20 k
      21 l
      22 m
      23 n
      24 o
      25 ô
      26 p
      27 q
      28 r
      29 s
      30 t
      31 u
      32 ù
      33 û
      34 ü
      35 v
      36 w
      37 x
      38 y
      39 ÿ
      40 z

      Personally I think CF has got it wrong, and the locale-sensitivity should just be done automatically. It's not the sort of thing one would not want to have happen, given the choice, surely?

      But Railo is not locale-sensitive here, and I think it should be, yes?


      Adam

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                adamcameroncf Adam Cameron
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: