Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-123195

Differences in functionality in Web browsers and QML for the JavaScript String localeCompare API

XMLWordPrintable

      let strings = ["华数酷喵   ","芒果TV车载版   ", "哔哩哔哩   ", "车鱼视听   ", "爱奇艺   ", "唱吧   ", "USB", "C", "B", "A"];

      strings.sort(function(a, b)

      { var titleA = a   var titleB = b   return titleA.localeCompare(titleB, "zh-CN"); }

      );

      console.log(strings)

      expected output and web browser output
      ["爱奇艺", "哔哩哔哩", "唱吧", "车鱼视听", "华数酷喵", "芒果TV车载版", "A", "B", "C", "USB"]

      qml output
      [A,B,C,USB,芒果TV车载版,爱奇艺,车鱼视听,唱吧,哔哩哔哩,华数酷喵]

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtqmlteam Qt Qml Team User
            benjamin_lee Benjamin Lee
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes