3d-viewer can't find 3d model in relative path if KISYS3DMOD have any accented character

Bug #1550620 reported by Raphael David François
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
jean-pierre charras

Bug Description

Application: kicad
Version: (2016-02-26 BZR 6593)-product release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.8.5,wx containers,compatible with 2.8)
Platform: Linux 3.19.0-51-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

Steps:

    - Run Kicad;
    - Preferences->Configure Paths;
    - Change KISYS3DMOD to contain an accented character (ex: â, á, à, ã);
    - Ok;
    - Restart Kicad;
    - Open pcbnew;
    - Add a footprint with 3D model in relative path;
    - Open 3d-viewer: 3D model wont be visible, debug show: 3D shape 'smd/chip_cms.wrl' not found, even tried 'smd/chip_cms.wrl' after env var substitution;

After some messing around I found that the problem is that loadCommonSettings() is executed before SetLanguage() in PGM_BASE::initPgm. Because of that the locale for handling accented characters isn't set and it->second.GetValue() fail to generate a string, making SetLocalEnvVariable() create an empty Environment variable.

system locale:
raphael@DeathStar:~ $ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

A patch is attached and it seems to fixed the problem.

Tags: 3d-viewer

Related branches

Revision history for this message
Raphael David François (raphaeldavidf) wrote :
tags: added: 3d-viewer
Changed in kicad:
assignee: nobody → jean-pierre charras (jp-charras)
Changed in kicad:
status: New → Fix Committed
Revision history for this message
Raphael David François (raphaeldavidf) wrote :

Thanks Jean-Pierre!

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.