<div dir="ltr">Hi Tobias,<div><br></div><div>Interesting!  I think 128 is the Euro symbol in extended ASCII on MS Windows.</div><div><br></div><div><a href="https://www.petefreitag.com/cheatsheets/ascii-codes/">https://www.petefreitag.com/cheatsheets/ascii-codes/</a><br></div><div><br></div><div>Thanks for the explanation!  It makes sense that it would have been a hack for code printing.  </div><div><br></div><div>All the best,</div><div><br></div><div>Ron Teitelbaum</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 2, 2018 at 2:26 PM, Tobias Pape <span dir="ltr"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi all<div><br><blockquote type="cite"><span class="">On 02.07.2018, at 19:29, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com" target="_blank">ron@usmedrec.com</a>> wrote:<br><br>That is strange.<br><br>On Squeak 4.1 <br><br>$^ charCode -> 94<br>94 asCharacter -> $^<br>128 asCharacter -> $€ charCode -> 128  (doesn't show properly in text on email but does in squeak, see image).<br><br></span><span id="m_-3945273927327903551cid:ii_jj4j1oin0_1645bffb52003a3f"><Capture.PNG></span><span class=""><br><br>In other words, if I use my keyboard to type it in, it seems to be represented fine and it evaluates to charCode 94 as expected.<br><br>But something created with 128 charCode also is represented with the same symbol and it also retains it's 128 charCode as you can see with you send charCode to the string representation that was created.<br><br>If this was filed out it would seem that either version could have been used in the code and you wouldn't notice it.  Manually changing it by typing in ^ and fileing it out again will probably fix it.  An external editor changing 128 to 94 chars will also probably work.<br><br>All the best,<br></span></blockquote><div><br></div><div>Maybe I can shed a bit light on things here. </div><div><br></div><div>If you look at the attached image (which is one of the default fonts we use), you see that ^ and _ are present after [\] but ALSO after {|}~. This seems to be intentional so that you, should you want, can switch betwen caret/underscore and up-arrow/left-arrow printing for return/assignment and here's how it's done:</div><div><br></div><div>StrikeFont>>useLeftArrow</div><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">  </span>self characterToGlyphMap.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">      </span>characterToGlyphMap at: 96 put: 95.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">    </span>characterToGlyphMap at: 95 put: 94</div><div><br></div><div>and</div><div><br></div><div>StrikeFont>>useUnderscore</div><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap"> </span>self characterToGlyphMap.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">      </span>characterToGlyphMap at: 96 put: 129.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">   </span>characterToGlyphMap at: 95 put: 128<div><br></div><div><br></div><div>There's the 128.</div><div><br></div><div>What happens here, too, is that 128 is no proper character to begin with.</div><div><br></div><div>Our characters represent unicode codepoints, which, for ByteStrings, happen to _exactly_ match the ISO 8859-1 (Latin1) encoding. (In fact, that was a design decision for Unicode to begins with; does NOT hold for UTF-8 tho).</div><div><br></div><div>In both, Unicode and ISO 8859-1, certain "character codes" are not actually characters. The control characters (<32) are intentionally undefined, as are codes between 128 and 159 (includes 128). However, 8859-1 was often combined with Ansi escape codes (aka ISO 6429), which defines the codes from 128 as Control Block C1, which Unicode subsequently adopted.</div><div><br></div><div>Long story short, Characters between 128 and 159 are inherently non-printable. Either they control output or format output, but cannot in themselves be displayed. The StrikeFonts utilize that and use those code points in fonts to relocate caret, underscore, left-arrow and right-arrow so that they can serve as substitutes when you don't want ^ _ in code but rather arrows.</div><div><br><div>=-=-=-=-=</div><div><br></div><div>That being said, I just saw that the fileList forces MacRoman encoding (deprecated since MacOS X 10.0 in 2001....) which _has_ a proper meaning for 128, namely Ä. However, the respective method probably needs an overhaul:</div><div><br></div><div>FileList>>defaultEncoderFor: aFileName<br><br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">     </span>"This method just illustrates the stupidest possible implementation of encoder selection."<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">   </span>| l |<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">  </span>l := aFileName asLowercase.<br>"<span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">      </span>((l endsWith: FileStream multiCs) or: [<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">                </span>l endsWith: FileStream multiSt]) ifTrue: [<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">             </span>^ UTF8TextConverter new.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">       </span>].<br>"<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">     </span>((l endsWith: FileStream cs) or: [<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">             </span>l endsWith: FileStream st]) ifTrue: [<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">          </span>^ MacRomanTextConverter new.<br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">   </span>].<br><br><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">   </span>^ Latin1TextConverter new.<br><br>=-=-=-=-=-=</div><div><br></div><div>Indeed, the file x.cs contains an 128 at the indicated position. Which is in the middle of a binary SmartRefStream-dump. Maybe we must change the fileIn logic to make the stream binary when it encounters a smartrefstream? that would certainly help. </div><div><br></div><div>Best regards</div><div><span class="m_-3945273927327903551Apple-tab-span" style="white-space:pre-wrap">   </span>-Tobias</div><div><br></div><div><br><div><br></div><img id="m_-3945273927327903551A14259D6-31F7-48A7-A05E-9CA3D72C8664" height="10" width="996" src="cid:26DD849D-5E02-4CF0-A417-1316E4E0FA22@fritz.box"><span class=""><br><blockquote type="cite"><br>Ron Teitelbaum<br><br><br>On Mon, Jul 2, 2018 at 12:23 PM, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.<wbr>com</a>> wrote:<br> <br>Hi Subbu,<br><br>> On Jul 2, 2018, at 7:24 AM, K K Subbu <<a href="mailto:kksubbu.ml@gmail.com" target="_blank">kksubbu.ml@gmail.com</a>> wrote:<br>> <br>> Hi,<br>> <br>> I need help in tracing a bug (see attached picture) which triggered a MNU while trying to view a .cs file in FileTool. I traced the problem to peek on aStream returning a nil because a wrong character code was being returned in generated.<br>> <br>> In the attached picture, aStream isBinary is false and the basicNext returns the correct $^ character which gets stored in character1 local var. But an inspector displays it as Character 128. In the same inspector window $^ shows the correct character code as 94.<br>> <br>> This is on Squeak5.2alpha-64b-Linux-<wbr>18127. What is happening here?<br><br>No idea.  Do you have a test case?<br><br>> Has anyone seen this type of behavior before?<br>> <br>> <br>> Thanks in advance .. Subbu<br>> <strangeCharBug.png><br><br></blockquote><br></span></div></div></div></blockquote></div><br></div></div>