Boost C++ Libraries: Ticket #11878: Locale dependend number formatting doesn't work with MSVC release config https://svn.boost.org/trac10/ticket/11878 <p> I have this Problem on Windows with Visual Studio 2015 and boost 1.60. The formatting of float numbers is not working properly, when using Release configuration with dynamic runtime. The Debug configuration or the Release with static runtime work as expected. This can be quite a show stopper if one is relying on boost::locale for number formatting. </p> <p> For a german locale the number must be formatted as "2,14". In Release config is formatted as "2.14" </p> <p> Here is the test code and the output for Debug and Release. </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;locale&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;string&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&quot;boost/locale.hpp&quot;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">using</span> <span class="k">namespace</span> <span class="n">std</span><span class="p">;</span> <span class="kt">float</span> <span class="n">v</span> <span class="o">=</span> <span class="mf">2.14f</span><span class="p">;</span> <span class="c1">// Use std locale to format a float</span> <span class="k">auto</span> <span class="n">stdLocale</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">locale</span><span class="p">(</span><span class="s">&quot;German_germany&quot;</span><span class="p">);</span> <span class="n">cout</span><span class="p">.</span><span class="n">imbue</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">v</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">stdNumPunct</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale decimal_point &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">stdNumPunct</span><span class="p">.</span><span class="n">decimal_point</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale num_put &quot;</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">stdFacet</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">num_put</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">stdFacet</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">cout</span><span class="p">,</span> <span class="n">cout</span><span class="p">,</span> <span class="sc">&#39;0&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="c1">// Use boost locale to format a float</span> <span class="n">boost</span><span class="o">::</span><span class="n">locale</span><span class="o">::</span><span class="n">generator</span> <span class="n">gen</span><span class="p">;</span> <span class="k">auto</span> <span class="n">boostLocale</span> <span class="o">=</span> <span class="n">gen</span><span class="p">(</span><span class="s">&quot;de_DE.UTF-8&quot;</span><span class="p">);</span> <span class="n">cout</span><span class="p">.</span><span class="n">imbue</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">boost</span><span class="o">::</span><span class="n">locale</span><span class="o">::</span><span class="n">as</span><span class="o">::</span><span class="n">number</span> <span class="o">&lt;&lt;</span> <span class="n">v</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">boostNumPunct</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale decimal_point &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">boostNumPunct</span><span class="p">.</span><span class="n">decimal_point</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale num_put &quot;</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">boostFacet</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">num_put</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">boostFacet</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">cout</span><span class="p">,</span> <span class="n">cout</span><span class="p">,</span> <span class="sc">&#39;0&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><pre class="wiki">...\Debug&gt; LocaleNumPunct.exe std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2,14 boost locale decimal_point , boost locale num_put 2,14 ...\Release&gt;LocaleNumPunct.exe std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2.14 boost locale decimal_point , boost locale num_put 2.14 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11878 Trac 1.4.3 Artyom Beilis Tue, 29 Dec 2015 19:44:55 GMT <link>https://svn.boost.org/trac10/ticket/11878#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:1</guid> <description> <p> Several things: </p> <ol><li>Does both release and Debug linked to ICU or not? </li><li>Does your static build is liked to static runtime or dynamic? </li><li>Do you link your application to static or dynamic runtime. </li></ol><p> Note: both boost-locale and application must have access to same runtime. Best is to use dynamic build for both runtime and boost-locale. </p> <p> It is most likely your configuration/build combination issue - i.e. something compiled with something incompatible. </p> <p> So please try to check exactly all your build/link options and boost-locale configuration. </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Tue, 29 Dec 2015 20:32:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11878#comment:1" title="Comment 1">artyom</a>: </p> <blockquote class="citation"> <ol><li>Does both release and Debug linked to ICU or not? </li></ol></blockquote> <p> There is no ICU, just the default Windows backend. </p> <blockquote class="citation"> <ol start="2"><li>Does your static build is liked to static runtime or dynamic? </li></ol></blockquote> <p> I've tried both, Release config with boost static and runtime static works. Release config with boost static and runtime dynamic (my production config) does _not_ work. </p> <blockquote class="citation"> <ol start="3"><li>Do you link your application to static or dynamic runtime. </li></ol></blockquote> <p> See the previous answer. </p> <blockquote class="citation"> <p> Note: both boost-locale and application must have access to same runtime. Best is to use dynamic build for both runtime and boost-locale. </p> </blockquote> <p> I've tested this too (boost as dll with shared runtime), I've thought would be a workaround, it does _not_ work. I have disabled the optimizations and tried to see, in the inspector window of the debugger, some diferences between the static and the dynamic build, but couldn't notice anything suspicious. </p> <blockquote class="citation"> <p> It is most likely your configuration/build combination issue - i.e. something compiled with something incompatible. </p> <p> So please try to check exactly all your build/link options and boost-locale configuration. </p> </blockquote> <p> I think I've checked and tried every combination. I have no other ideas. If I can help with any binary artifacts or other information, please let me know. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Tue, 29 Dec 2015 20:46:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:3</guid> <description> <blockquote class="citation"> <p> Release config with boost static and runtime dynamic (my production config) does _not_ work. </p> </blockquote> <p> There maybe some confusion. If you build boost with <code>runtime-link=static</code> it creates static library linked to STATIC runtime. And if you use one they refer to "same" stuff in standard library that would actually be different!. </p> <p> You should may use static library liked to dynamic runtime and yourself link to dynamic runtime so you both look into same DLL. </p> <p> Think of this: when boost locale uses/installs facet - it uses some stuff placed in MSVC DLL and if other code does not use the dll it would miss it. </p> <p> It is critical to do linking correctly. </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Tue, 29 Dec 2015 21:16:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11878#comment:3" title="Comment 3">artyom</a>: </p> <blockquote class="citation"> <blockquote class="citation"> <p> Release config with boost static and runtime dynamic (my production config) does _not_ work. </p> </blockquote> <p> There maybe some confusion. If you build boost with <code>runtime-link=static</code> it creates static library linked to STATIC runtime. And if you use one they refer to "same" stuff in standard library that would actually be different!. </p> <p> You should may use static library liked to dynamic runtime and yourself link to dynamic runtime so you both look into same DLL. </p> </blockquote> <p> Exactly, that's how I'm using it. Sorry not beeing clear enough. So this configuration would be with boost beeing compiled so: </p> <blockquote class="citation"> <p> b2 link=static threading=multi runtime-link=shared stage </p> </blockquote> <p> The test app uses also shared runtime: Multi-threaded DLL (/MD) This app links then libboost_locale-vc140-mt-1_60.lib (so the static compiled boost lib that uses the shared runtime). So everybody does look in the same runtime dll. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Tue, 29 Dec 2015 21:32:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:5</guid> <description> <p> Can you show me the exact command line you compile your sample application with. </p> <p> Yes the library should be ok I just need to have FULL parameters as is (even better some bat file to copy-paste) so I can reporduce exactly the issue you report. </p> <p> The problem is that there so many variables that even a single flag can mess the stuff around. </p> <p> So please provide (as comands list: </p> <ol><li>Command you build the boost-locale and where: </li><li>List of created libraries - make sure before it is clean </li><li>Command you build your sample code and where </li><li>Output. </li></ol><p> Also small question: does it happen with different version of MSVC? </p> <p> There was a case when MSVC had actually fixed their code because it didn't link properly with boost-locale (they missed some dll-export/import stuff) </p> <p> Just want to make sure we don't have the same case. (Can't find right now the reference) </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Wed, 30 Dec 2015 09:21:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11878#comment:5" title="Comment 5">artyom</a>: </p> <blockquote class="citation"> <p> So please provide (as comands list: </p> </blockquote> <p> boost build </p> <pre class="wiki">D:\LIBS\boost_1_60_0&gt;b2 -d+2 --debug-building link=static threading=multi runtime-link=shared stage </pre><p> I've used -d+2 and --debug-building to see the used compilation flags. </p> <p> Extract from the boost building output </p> <pre class="wiki">file bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\win32\win_backend.obj.rsp "libs\locale\src\win32\win_backend.cpp" -Fo"bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\win32\win_backend.obj" -TP /O2 /Ob2 /W3 /GR /MD /Zc:forScope /Zc:wchar_t /wd4675 /EHs -c -DBOOST_ALL_NO_LIB=1 -DBOOST_LOCALE_NO_POSIX_BACKEND=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_NO_LIB=1 -DNDEBUG "-I." compile-c-c++ bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\win32\win_backend.obj call "C:\Users\Tavi\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" &gt;nul cl /Zm800 -nologo @"bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\win32\win_backend.obj.rsp" ... link /lib /NOLOGO /out:"bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\libboost_locale-vc140-mt-1_60.lib" @"bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\libboost_locale-vc140-mt-1_60.lib.rsp" copy /b "bin.v2\libs\locale\build\msvc-14.0\release\link-static\threading-multi\libboost_locale-vc140-mt-1_60.lib" + this-file-does-not-exist-A698EE7806899E69 "stage\lib\libboost_locale-vc140-mt-1_60.lib" </pre><p> For this test, I used the command line and exactly the same flags as used by boost. I've copied the generated b2_msvc_14.0_vcvarsall_x86.cmd to have the same environment: path, include and libpath. </p> <p> Build the test app: </p> <pre class="wiki">call b2_msvc_14.0_vcvarsall_x86.cmd cl "LocaleNumPunct.cpp" /Zm800 -nologo -DNDEBUG -TP /O2 /Ob2 /W3 /GR /MD /Zc:forScope /Zc:wchar_t /wd4675 /EHs /I"D:\LIBS\boost_1_60_0" /link "libboost_locale-vc140-mt-1_60.lib" "libboost_system-vc140-mt-1_60.lib" /LIBPATH:"D:\LIBS\boost_1_60_0\stage\lib" </pre><p> <a class="missing wiki">LocaleNumPunct</a>.cpp </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;locale&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;string&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&quot;boost/locale.hpp&quot;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">using</span> <span class="k">namespace</span> <span class="n">std</span><span class="p">;</span> <span class="kt">float</span> <span class="n">v</span> <span class="o">=</span> <span class="mf">2.14f</span><span class="p">;</span> <span class="c1">// Use std locale to format a float</span> <span class="k">auto</span> <span class="n">stdLocale</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">locale</span><span class="p">(</span><span class="s">&quot;German_germany&quot;</span><span class="p">);</span> <span class="n">cout</span><span class="p">.</span><span class="n">imbue</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">v</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">stdNumPunct</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale decimal_point &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">stdNumPunct</span><span class="p">.</span><span class="n">decimal_point</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;std locale num_put &quot;</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">stdFacet</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">num_put</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">stdLocale</span><span class="p">);</span> <span class="n">stdFacet</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">cout</span><span class="p">,</span> <span class="n">cout</span><span class="p">,</span> <span class="sc">&#39;0&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="c1">// Use boost locale to format a float</span> <span class="n">boost</span><span class="o">::</span><span class="n">locale</span><span class="o">::</span><span class="n">generator</span> <span class="n">gen</span><span class="p">;</span> <span class="k">auto</span> <span class="n">boostLocale</span> <span class="o">=</span> <span class="n">gen</span><span class="p">(</span><span class="s">&quot;de_DE.UTF-8&quot;</span><span class="p">);</span> <span class="n">cout</span><span class="p">.</span><span class="n">imbue</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">boost</span><span class="o">::</span><span class="n">locale</span><span class="o">::</span><span class="n">as</span><span class="o">::</span><span class="n">number</span> <span class="o">&lt;&lt;</span> <span class="n">v</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">boostNumPunct</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale decimal_point &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">boostNumPunct</span><span class="p">.</span><span class="n">decimal_point</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;boost locale num_put &quot;</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">boostFacet</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">num_put</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">boostLocale</span><span class="p">);</span> <span class="n">boostFacet</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">cout</span><span class="p">,</span> <span class="n">cout</span><span class="p">,</span> <span class="sc">&#39;0&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> <a class="missing wiki">LocaleNumPunct</a>.exe output: </p> <pre class="wiki">std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2.14 boost locale decimal_point , boost locale num_put 2.14 </pre><blockquote class="citation"> <p> Also small question: does it happen with different version of MSVC? </p> </blockquote> <p> Unfortunatelly, I do not have the previous MSVC at hand. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Wed, 30 Dec 2015 10:23:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:7</guid> <description> <p> Ok, it works 100% from me for MSVC 10 (Don't have 15 so can't check) </p> <p> For me it starts looking like MSVC bug. </p> <p> Can you please add following lines to code at the end: </p> <pre class="wiki"> cout &lt;&lt; "boost locale num_put "; auto&amp; boostFacet = std::use_facet&lt;std::num_put&lt;char&gt;&gt;(boostLocale); std::cout &lt;&lt; typeid(boostFacet).name() &lt;&lt; std::endl; std::cout &lt;&lt; "Has Facet: "&lt;&lt; std::has_facet&lt;boost::locale::info&gt;(boostLocale) &lt;&lt; std::endl; boostFacet.put(cout, cout, '0', v); cout &lt;&lt; endl; </pre><p> My output for MSVC10 is </p> <pre class="wiki">E:\Projects\modular-boost\tmp&gt;LocaleNumPunct.exe std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2,14 boost locale decimal_point , boost locale num_put class boost::locale::impl_win::num_format&lt;char&gt; Has Facet: 1 2,14 </pre><p> Note the name of num_put facet and see that info is installed. </p> <p> It also can be <code> boost::locale::util::base_num_format&lt;char&gt;</code> depending on backend Can you please run the modified sample. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Wed, 30 Dec 2015 10:35:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:8</guid> <description> <p> One more: can you try to use std backed by adding these lines and report the result: </p> <pre class="wiki">boost::locale::localization_backend_manager my = boost::locale::localization_backend_manager::global(); my.select("std"); boost::locale::generator gen(my); </pre><p> </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Wed, 30 Dec 2015 11:18:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:9</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11878#comment:7" title="Comment 7">artyom</a>: </p> <blockquote class="citation"> <p> Can you please add following lines to code at the end: </p> </blockquote> <p> My output is: </p> <pre class="wiki"> d:\SCRATCH\LocaleNumPunct&gt;LocaleNumPunct.exe std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2.14 boost locale decimal_point , boost locale num_put class boost::locale::impl_win::num_format&lt;char&gt; Has Facet: 1 2.14 </pre><blockquote class="citation"> <p> can you try to use std backed by adding these lines and report the result </p> </blockquote> <p> With std backend I get: </p> <pre class="wiki">std locale 2,14 std locale decimal_point , std locale num_put 2,14 boost locale 2.14 boost locale decimal_point , boost locale num_put class boost::locale::util::base_num_format&lt;char&gt; Has Facet: 1 2.14 </pre><p> The types seem to be ok. </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Wed, 30 Dec 2015 13:00:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:10</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/11878#comment:7" title="Comment 7">artyom</a>: </p> <blockquote class="citation"> <p> For me it starts looking like MSVC bug. </p> </blockquote> <p> You are right. I have isolated it. The dynamic release runtime ignores the numpunct facet: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;locale&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cm">/* Customized numpunct facet */</span> <span class="k">class</span> <span class="nc">MyNumPunct</span> <span class="o">:</span> <span class="k">public</span> <span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;</span> <span class="p">{</span> <span class="k">public</span><span class="o">:</span> <span class="n">MyNumPunct</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">refs</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">:</span> <span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;</span><span class="p">(</span><span class="n">refs</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span> <span class="k">protected</span><span class="o">:</span> <span class="kt">char</span> <span class="n">do_decimal_point</span><span class="p">()</span> <span class="k">const</span> <span class="k">override</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot; &quot;</span> <span class="n">__FUNCTION__</span> <span class="s">&quot; &quot;</span><span class="p">;</span> <span class="k">return</span> <span class="sc">&#39;,&#39;</span><span class="p">;</span> <span class="p">}</span> <span class="p">};</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">using</span> <span class="k">namespace</span> <span class="n">std</span><span class="p">;</span> <span class="kt">float</span> <span class="n">v</span> <span class="o">=</span> <span class="mf">2.14f</span><span class="p">;</span> <span class="c1">// Use a modified locale</span> <span class="k">auto</span> <span class="n">myLocale</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">locale</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">locale</span><span class="o">::</span><span class="n">classic</span><span class="p">(),</span> <span class="k">new</span> <span class="n">MyNumPunct</span><span class="p">);</span> <span class="n">cout</span><span class="p">.</span><span class="n">imbue</span><span class="p">(</span><span class="n">myLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;stream &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">v</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">myNumPunct</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">numpunct</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">myLocale</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;decimal_point &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">myNumPunct</span><span class="p">.</span><span class="n">decimal_point</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;num_put &quot;</span><span class="p">;</span> <span class="k">auto</span><span class="o">&amp;</span> <span class="n">myFacet</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">use_facet</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">num_put</span><span class="o">&lt;</span><span class="kt">char</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">myLocale</span><span class="p">);</span> <span class="n">myFacet</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">cout</span><span class="p">,</span> <span class="n">cout</span><span class="p">,</span> <span class="sc">&#39;0&#39;</span><span class="p">,</span> <span class="n">v</span><span class="p">);</span> <span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">endl</span><span class="p">;</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> Config Debug OK </p> <pre class="wiki">stream MyNumPunct::do_decimal_point 2,14 MyNumPunct::do_decimal_point decimal_point , num_put MyNumPunct::do_decimal_point 2,14 </pre><p> Config Release static runtime (/MT) OK </p> <pre class="wiki">stream MyNumPunct::do_decimal_point 2,14 MyNumPunct::do_decimal_point decimal_point , num_put MyNumPunct::do_decimal_point 2,14 </pre><p> Config Release dynamic runtime (/MD) BAD </p> <pre class="wiki">stream 2.14 MyNumPunct::do_decimal_point decimal_point , num_put 2.14 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Wed, 30 Dec 2015 13:37:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:11</guid> <description> <p> Great!!! </p> <p> Thanks. </p> <p> Now it is time to open a ticket for MSVC. </p> <p> I'll drop the mail to Boost mailing list. </p> <p> If it is ok for you I'll close the ticket. </p> </description> <category>Ticket</category> </item> <item> <author>octavian.cacina@…</author> <pubDate>Wed, 30 Dec 2015 14:05:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11878#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11878#comment:12</guid> <description> <p> I tried to post this earlier but trac reported it as spam. Now another try. </p> <p> I've reported the MSVC bug here: <a class="ext-link" href="https://connect.microsoft.com/VisualStudio/feedback/details/2185894"><span class="icon">​</span>https://connect.microsoft.com/VisualStudio/feedback/details/2185894</a> You may close this ticket then. Thank you. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Artyom Beilis</dc:creator> <pubDate>Wed, 30 Dec 2015 14:09:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11878#comment:13 https://svn.boost.org/trac10/ticket/11878#comment:13 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Closes as it is MSVC issues that need to be resolved by Microsoft. </p> Ticket