<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11153</bug_id>
          
          <creation_ts>2017-03-14 16:22:51 +0000</creation_ts>
          <short_desc>Generated locales does not support UTF-8 encoding</short_desc>
          <delta_ts>2017-03-20 15:38:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.2.1</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yocto User">yoctouser</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71256</commentid>
    <comment_count>0</comment_count>
    <who name="Yocto User">yoctouser</who>
    <bug_when>2017-03-14 16:22:51 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
Host system: Ubuntu 14.04.5 LTS (Trusty Tahr)
Yocto version: YP Core - Morty 2.2.1
Target: SABRE Board for Smart Devices based on i.MX 6Quad processor
Additional meta: meta-freescale, meta-freescale-3rdparty, meta-freescale-distro

Triggering Action/Cause
-----------------------
Modified the local.conf to specify the desired locales with the add of the following variable:
IMAGE_LINGUAS = &quot;de-de fr-fr en-gb en-gb.iso-8859-1 en-us en-us.iso-8859-1 zh-cn&quot;

Modified the local.conf to exclude BusyBox and include some standard utilities:
IMAGE_INSTALL_append = &quot; glibc-utils util-linux coreutils&quot;

Built a base image with the command:
bitbake core-image-base

Booted the image into the SABRE board

Edited the /etc/profile file as follow:
export LC_ALL=en_US
export LANG=en_US
export LANGUAGE=en_US

Rebooted the board

Expectation
-----------
The en_US locale is set, the system fully supports UTF-8 encoding. I can manage and display file names that include UTF-8 characters.

Actual Result
-------------
The locale is set to &quot;en_US&quot;, below the output of the &quot;locale&quot; command:
LANG=en_US
LC_CTYPE=&quot;en_US&quot;
LC_NUMERIC=&quot;en_US&quot;
LC_TIME=&quot;en_US&quot;
LC_COLLATE=&quot;en_US&quot;
LC_MONETARY=&quot;en_US&quot;
LC_MESSAGES=&quot;en_US&quot;
LC_PAPER=&quot;en_US&quot;
LC_NAME=&quot;en_US&quot;
LC_ADDRESS=&quot;en_US&quot;
LC_TELEPHONE=&quot;en_US&quot;
LC_MEASUREMENT=&quot;en_US&quot;
LC_IDENTIFICATION=&quot;en_US&quot;
LC_ALL=en_US

but the system does not support correctly the UTF-8 encoding.

Please consider the following scenarios:

CASE 1) From target device to outsite
- Connect to the target with a terminal
- Check that the terminal encoding is set to UTF-8
- Touch a file into a pendrive including in the file name accented characters, e.g. à,è,ì,ò,ù
- Connect the pendrive to a Windows system, browse the pen drive
- The file name appears corrupted
- Connect the pendrive to a Linux system (desktop distro, e.g. Ubuntu), browse the pen drive
- The file name appears corrupted (the file name is displayed corrupted exactly as in Windows)

CASE 2) From outside to target device
- Connect a pendrive to a Windows system
- Create a file into the pendrive including in the file name accented characters, e.g. à,è,ì,ò,ù
- Connect the pendrive to a Linux system (desktop distro, e.g. Ubuntu), browse the pen drive
- The file name appears correctly
- Connect to the target with a terminal
- Check that the terminal encoding is set to UTF-8
- Connect the pendrive to the target, browser the pendrive
- The file name appears corrupted

Why en_US locale is not working well with UTF-8? 
Why en_US locale does not have the .UTF-8 suffix? 
How can I check that the en_US locale supports the UTF-8 encoding?

Reproducibility
---------------
Always

Thanks in advance for your time

Best regards,
Fabio Emiliani</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71299</commentid>
    <comment_count>1</comment_count>
    <who name="Yocto User">yoctouser</who>
    <bug_when>2017-03-15 10:04:48 +0000</bug_when>
    <thetext>As suggested here: http://stackoverflow.com/questions/42784435/how-to-check-if-a-locale-is-utf-8/42797421#42797421, I&apos;ve used the nl_langinfo API to detected the encoding of a locale. This is the output:

./LangInfoInspector $(locale -a)
C -&gt;ANSI_X3.4-1968
de_DE -&gt;UTF-8
en_GB -&gt;UTF-8
en_GB.ISO-8859-1 -&gt;ISO-8859-1
en_US -&gt;UTF-8
en_US.ISO-8859-1 -&gt;ISO-8859-1
fr_FR -&gt;UTF-8
POSIX -&gt;ANSI_X3.4-1968
zh_CN -&gt;UTF-8

so I confirm that en_US, en_GB and similar are UTF-8 encoded (even if there is no .utf8 suffix).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71388</commentid>
    <comment_count>2</comment_count>
    <who name="Yocto User">yoctouser</who>
    <bug_when>2017-03-17 13:50:02 +0000</bug_when>
    <thetext>I&apos;ve made further tests and noticed that ISO-8859-1 locales works fine.

If using en_US.ISO-8859-1 I&apos;m able to see accented characters such as: à,è,ì,ò,ù. 

See below:
root@imx6qsabresd:/media/win/italiano# ls -la
total 12
drwxr-xr-x 3 root root 4096 Mar 13 15:11 .
drwxr-xr-x 8 root root 4096 Mar 13 14:57 ..
drwxr-xr-x 2 root root 4096 Mar 13 14:58 mà_però
-rwxr-xr-x 1 root root    0 Mar 13 14:57 mà_però.txt

The directory and file mà_però has been created under Windows. Accented à and ò are correctly displayed.

Tested under PuTTY using the following settings (Change settings -&gt; Window -&gt; Translation):
ISO-8859-1:1998 (Latin-1, West Europe)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71450</commentid>
    <comment_count>3</comment_count>
    <who name="Yocto User">yoctouser</who>
    <bug_when>2017-03-20 15:38:42 +0000</bug_when>
    <thetext>The problem is caused by the mount of the pendrive. The default mount options include: iocharset=iso8859-1, with this option the pendrive file system is interpreted as ISO 8859-1 and not UTF-8. Solved using iocharset=utf8. See: http://unix.stackexchange.com/q/352144/191458</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>