Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Detected locale "C" with character encoding "ANSI_X3.4-1968"

Detected locale "C" with character encoding "ANSI_X3.4-1968"

Scheduled Pinned Locked Moved Solved Installation and Deployment
4 Posts 3 Posters 3.9k 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.
  • D Offline
    D Offline
    DungeonLords
    wrote on 7 Nov 2024, 01:43 last edited by DungeonLords 11 Jul 2024, 01:46
    #1

    Hello! In my own Linux image I try to start any Qt app. But I get warning

    Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
    Qt depends on a UTF-8 locale, but has failed to switch to one.
    If this causes problems, reconfigure your locale. See the locale(1) manual
    for more information.
    

    But if I do

    export LC_ALL=en_US.utf8 && ./myapp
    

    Then works without warning. How to ask Qt to switch to en_US.utf8 by himself? May be set something in my toolchain_cross.cmake file? I use it to build Qt from source code...

    J 1 Reply Last reply 7 Nov 2024, 06:56
    0
    • D DungeonLords
      7 Nov 2024, 01:43

      Hello! In my own Linux image I try to start any Qt app. But I get warning

      Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
      Qt depends on a UTF-8 locale, but has failed to switch to one.
      If this causes problems, reconfigure your locale. See the locale(1) manual
      for more information.
      

      But if I do

      export LC_ALL=en_US.utf8 && ./myapp
      

      Then works without warning. How to ask Qt to switch to en_US.utf8 by himself? May be set something in my toolchain_cross.cmake file? I use it to build Qt from source code...

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 7 Nov 2024, 06:56 last edited by
      #2

      @DungeonLords You should rather change your locale to UTF-8. This should actually be the default with most Linux distributions. What Linux distribution do you use.

      You can check what locale is configured on your system using "locale" command.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • D DungeonLords has marked this topic as solved on 8 Nov 2024, 11:06
      • T Offline
        T Offline
        turmoiloil
        wrote on 10 Nov 2024, 19:23 last edited by
        #3

        anonymous@amnesia:~/vlc$ locale
        LANG=C.UTF-8
        LANGUAGE=
        LC_CTYPE="C.UTF-8"
        LC_NUMERIC="C.UTF-8"
        LC_TIME="C.UTF-8"
        LC_COLLATE="C.UTF-8"
        LC_MONETARY="C.UTF-8"
        LC_MESSAGES="C.UTF-8"
        LC_PAPER="C.UTF-8"
        LC_NAME="C.UTF-8"
        LC_ADDRESS="C.UTF-8"
        LC_TELEPHONE="C.UTF-8"
        LC_MEASUREMENT="C.UTF-8"
        LC_IDENTIFICATION="C.UTF-8"
        LC_ALL=
        this is the output of the locale command. i guess my locale is utf8. why am i still getting this error: configure: error: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
        Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
        If this causes problems, reconfigure your locale. See the locale(1) manual

        J 1 Reply Last reply 11 Nov 2024, 06:42
        0
        • T turmoiloil
          10 Nov 2024, 19:23

          anonymous@amnesia:~/vlc$ locale
          LANG=C.UTF-8
          LANGUAGE=
          LC_CTYPE="C.UTF-8"
          LC_NUMERIC="C.UTF-8"
          LC_TIME="C.UTF-8"
          LC_COLLATE="C.UTF-8"
          LC_MONETARY="C.UTF-8"
          LC_MESSAGES="C.UTF-8"
          LC_PAPER="C.UTF-8"
          LC_NAME="C.UTF-8"
          LC_ADDRESS="C.UTF-8"
          LC_TELEPHONE="C.UTF-8"
          LC_MEASUREMENT="C.UTF-8"
          LC_IDENTIFICATION="C.UTF-8"
          LC_ALL=
          this is the output of the locale command. i guess my locale is utf8. why am i still getting this error: configure: error: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
          Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
          If this causes problems, reconfigure your locale. See the locale(1) manual

          J Online
          J Online
          jsulm
          Lifetime Qt Champion
          wrote on 11 Nov 2024, 06:42 last edited by
          #4

          @turmoiloil said in Detected locale "C" with character encoding "ANSI_X3.4-1968":

          why am i still getting this error

          Looks like Qt does not support C.UTF-8.
          How did you install Qt?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          4/4

          11 Nov 2024, 06:42

          • Login

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