Skip to content

fix(stm32cubeprog): character encoding "ANSI_X3.4-1968" warning#121

Open
fpistm wants to merge 1 commit into
stm32duino:mainfrom
fpistm:fix_encoding_warning
Open

fix(stm32cubeprog): character encoding "ANSI_X3.4-1968" warning#121
fpistm wants to merge 1 commit into
stm32duino:mainfrom
fpistm:fix_encoding_warning

Conversation

@fpistm

@fpistm fpistm commented Jul 22, 2026

Copy link
Copy Markdown
Member

Fixes warning:

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
for more information.

@fpistm fpistm added this to the 2.4.1/2.5.0 milestone Jul 22, 2026
@fpistm fpistm added the fix 🩹 Bug fix label Jul 22, 2026
@fpistm
fpistm requested a review from Copilot July 22, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the stm32CubeProg.sh wrapper to reduce Qt locale warnings by ensuring the environment uses a UTF-8 locale on Linux/macOS before invoking STM32CubeProgrammer.

Changes:

  • Add ensure_utf8_locale() to detect non-UTF-8 locales and switch to a UTF-8 locale when available.
  • Invoke the locale adjustment early in the script, after getopt capability detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread stm32CubeProg.sh
Comment thread stm32CubeProg.sh Outdated
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread stm32CubeProg.sh
Comment on lines +143 to +150
LOCALES_RES=$(locale -a 2>/dev/null || true)
if printf '%s\n' "${LOCALES_RES}" | grep -qi '^C\.UTF-8$'; then
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
elif printf '%s\n' "${LOCALES_RES}" | grep -qiE '^en_US\.(UTF-8|utf8)$'; then
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
fi
@fpistm fpistm removed this from the 2.5.0 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 🩹 Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants