Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. toLocaleUpperCase/toLocaleLowerCase alternative in Qt

toLocaleUpperCase/toLocaleLowerCase alternative in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 256 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miskol
    wrote on 14 Feb 2020, 10:24 last edited by miskol
    #1

    I just need to convert QString to upper/lower with locale in mind

    in JS there is something like this
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase

    so we can handle case like this:

    const city = 'istanbul';
    console.log(city.toLocaleUpperCase('en-US'));
    // expected output: "ISTANBUL"
    console.log(city.toLocaleUpperCase('TR'));
    // expected output: "İSTANBUL"

    I search in qml js implementation and it is unsupported :(
    Any idea ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Feb 2020, 10:31 last edited by
      #2

      Hi,

      You are looking for QLocale::toUpper.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4

      1/2

      14 Feb 2020, 10:24

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved