<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="" class="">Dear All,</div><div style="" class=""><br class=""></div><div style="" class=""><br class=""></div><div style="" class="">I do encounter a very strange Issue.</div><div style="" class=""><br class=""></div><div style="" class=""><div class="">I have been adding a test to `swift-corelibs-foundation/testJSONSerialization.swift`</div><div class="">This test succeed within swift-corelibs-foundation test, but fails when repackaged to a Cocoa CLI app.</div><div class=""><br class=""></div><div class=""><b class=""><u class="">The swift-corelibs-foundation test : </u></b></div><div class=""><br class=""></div><br class=""><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(198, 101, 118);" class="">func</span> test_serializeFloatingPointWithANonDotDecimalSeparatorLocale() {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: rgb(189, 178, 160);" class=""> </span>// We use a locale that is using "," as decimal separator.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(118, 194, 255);" class="">setlocale</span>(<span style="color: rgb(0, 177, 255);" class="">LC_ALL</span>,<span style="color: rgb(171, 69, 71);" class="">"fr_FR"</span>)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(0, 58, 93); min-height: 14px; font-size: 8px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(198, 101, 118);" class="">let</span> dictionary = [<span style="color: rgb(171, 69, 71);" class="">"decimalValue"</span>:<span style="color: rgb(139, 135, 255);" class="">1.1</span>]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(198, 101, 118);" class="">do</span>{</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(198, 101, 118);" class="">let</span> data = <span style="color: rgb(198, 101, 118);" class="">try</span> <span style="color: rgb(0, 153, 242);" class="">JSONSerialization</span>.<span style="color: rgb(118, 194, 255);" class="">data</span>(withJSONObject: dictionary)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: rgb(198, 101, 118);" class="">if</span> <span style="color: rgb(198, 101, 118);" class="">let</span> json = <span style="color: rgb(63, 167, 173);" class="">String</span>(data:data, encoding:.<span style="color: rgb(139, 194, 220);" class="">utf8</span>){</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(171, 69, 71); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: rgb(189, 178, 160);" class=""> </span><span style="color: rgb(118, 194, 255);" class="">XCTAssert</span><span style="color: rgb(189, 178, 160);" class="">(!json.</span><span style="color: rgb(118, 194, 255);" class="">contains</span><span style="color: rgb(189, 178, 160);" class="">(</span>","<span style="color: rgb(189, 178, 160);" class="">), </span>"Expected result: \"{\"decimalValue\":1.1000000000000001}\" found: \"<span style="color: rgb(189, 178, 160);" class="">\</span>(<span style="color: rgb(189, 178, 160);" class="">json</span>)\""<span style="color: rgb(189, 178, 160);" class=""> )</span></span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }<span style="color: rgb(198, 101, 118);" class="">else</span>{</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(171, 69, 71); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: rgb(189, 178, 160);" class=""> </span><span style="color: rgb(118, 194, 255);" class="">XCTFail</span><span style="color: rgb(189, 178, 160);" class="">(</span>"Failed during string encoding"<span style="color: rgb(189, 178, 160);" class="">)</span></span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }<span style="color: rgb(198, 101, 118);" class="">catch</span>{</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(171, 69, 71); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: rgb(189, 178, 160);" class=""> </span><span style="color: rgb(118, 194, 255);" class="">XCTFail</span><span style="color: rgb(189, 178, 160);" class="">(</span>"Failed during serialization"<span style="color: rgb(189, 178, 160);" class="">)</span></span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }</span></div><div style="margin: 0px; font-stretch: normal; font-size: 9.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }</span></div><div class=""><br class=""></div></div><div class=""><br class=""></div></div><div style="" class=""><u class=""><b class="">The simple CLI code that proves the bug (</b></u><b class=""><u class=""><a href="https://bugs.swift.org/browse/SR-6631" class="">https://bugs.swift.org/browse/SR-6631</a>)</u></b></div><div style="" class=""><br class=""></div><div style="" class=""><div style="margin: 0px; font-stretch: normal; font-size: 13.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">//</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">// main.swift</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">// doubleEncoding</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">//</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">// Created by Benoit Pereira da silva on 02/12/2017.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">// Copyright © 2017 Pereira da Silva. All rights reserved.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">//</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(0, 58, 93); min-height: 14px; font-size: 10px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: #c66576" class="">import</span> Foundation</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(0, 58, 93); min-height: 14px; font-size: 10px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">// Let's set to french</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(118, 194, 255); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">setlocale<span style="color: #bdb2a0" class="">(</span><span style="color: #00b1ff" class="">LC_ALL</span><span style="color: #bdb2a0" class="">,</span><span style="color: #ab4547" class="">"fr_FR"</span><span style="color: #bdb2a0" class="">)</span></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(0, 58, 93); min-height: 14px; font-size: 10px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(198, 101, 118); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">do<span style="color: #bdb2a0" class="">{</span></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: #c66576" class="">let</span> dictionary = [<span style="color: #ab4547" class="">"decimalValue"</span>:<span style="color: #8b87ff" class="">1.1</span>]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: #c66576" class="">let</span> data = <span style="color: #c66576" class="">try</span> <span style="color: #3fa7ad" class="">JSONSerialization</span>.<span style="color: #76c2ff" class="">data</span>(withJSONObject: dictionary)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: #c66576" class="">if</span> <span style="color: #c66576" class="">let</span> json = <span style="color: #3fa7ad" class="">String</span>(data:data, encoding:.<span style="color: #00b1ff" class="">utf8</span>){</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: #bdb2a0" class=""> </span>// the result is : "{"decimalValue":1,1000000000000001}"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(125, 126, 126); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: #bdb2a0" class=""> </span>// The decimal separator should not be "," but "."</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: #76c2ff" class="">print</span>(json)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> }</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(198, 101, 118); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""><span style="color: #bdb2a0" class="">}</span>catch<span style="color: #bdb2a0" class="">{</span></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class=""> <span style="color: #76c2ff" class="">print</span>(<span style="color: #ab4547" class="">"</span>\<span style="color: #ab4547" class="">(</span>error<span style="color: #ab4547" class="">)"</span>)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11.5px; line-height: normal; font-family: Menlo; color: rgb(189, 178, 160); background-color: rgb(0, 58, 93);" class=""><span style="font-size: 12px;" class="">}</span></div><div class=""><br class=""></div><div class=""><br class=""></div></div><div style="" class=""><br class=""></div><div style="" class="">Any idea ?</div><div style="" class="">I do use Toolchain: Swift Development Snapshot 2017-12-17 (a)</div><div style="" class=""><br class=""></div><div style="" class=""><br class=""></div><div style="" class="">Benoit</div><div style="" class=""><br class=""></div><div style="" class=""><br class=""></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 14px;" class=""><div apple-content-edited="true" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="font-size: 12px; line-height: normal; orphans: 2; widows: 2;" class=""><font face="HelveticaNeue-Light" class=""><div style="orphans: auto; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><b class="">Benoit Pereira da Silva</b></div><div style="margin: 0px; line-height: normal;" class="">Ultra Mobile Developer & Movement Activist</div><div style="margin: 0px; line-height: normal;" class="">Développeur Ultra Mobile & Militant du mouvement</div><div style="margin: 0px; line-height: normal;" class=""><a href="https://pereira-da-silva.com/" class="">https://pereira-da-silva.com</a></div><div style="margin: 0px; line-height: normal;" class=""><span style="line-height: normal;" class=""></span></div></div></div><div style="orphans: auto; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class=""></span></div></font></span></div></div></div></div></div></div><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;"><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;"><span><span><span><span><span><span><span><span><img apple-inline="yes" id="AD04EF54-43E1-4F54-92FA-3CD7547033F0" src="cid:E3AF4CA8-D774-47D1-AF27-2B086409AEED@home" class=""></span><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline"><br class=""></span></span></span></span></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><span><div style="font-family: HelveticaNeue-Light; orphans: 2; widows: 2;" class=""><div class=""><span style="orphans: auto; widows: auto; background-color: rgb(255, 255, 255);" class="">✄ --------------------------------</span><br style="orphans: auto; widows: auto;" class=""><font size="1" style="orphans: auto; widows: auto;" class="">This e-mail is confidential. Distribution, copy, publication or use of this information for any purpose is prohibited without agreement of the sender.<br class="">Ce message est confidentiel. Toute distribution, copie, publication ou usage des informations contenues dans ce message sont interdits sans agrément préalable de l'expéditeur.</font><br style="orphans: auto; widows: auto;" class=""></div></div></span></span></span></span></div><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;"><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;">
</span></span></span></span></span></span></span></span></span></div>
<br class=""></body></html>