<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel, hi Levente.</p>
<p><br>
</p>
<p>> <span style="font-size: 12pt;">Well, you ignored my question "What is a separator?".</span></p>
<div><br>
</div>
<div>Sorry for that. Well, I don't completely agree with your definition, I would rather follow the semantics of Unicode. The Unicode character category "separators" includes line separators (Zl), paragraph separators (Zp), and space separators (Zs) and nbsp
 is like Character space part of the space separators group. In other contexts like the web, afaik they are used very interchangeably anyway, so I hardly can imagine any scenario where something like #trimWhatespace should ignore these characters.</div>
<div>(By the way, zero-width space is not a space character at all according to Unicode but rather a formatting character (Cf).)</div>
<div><br>
</div>
<div>> <span style="font-size: 12pt;">Instead of modifying CharacterSet etc., one could maybe extend TextConverter to support encoding-aware identification of separators etc and also provide encoding-aware #trim.</span>
<div><br>
</div>
<div>I see your arguments for maintaining backward compatibility, but this proposal scares me a bit. I would really like String to see Unicode-aware by default (like perhaps every other modern programming language) instead of providing a separate interface
 that "a few exotic clients that care about other encodings" can use. :-)</div>
<div><br>
</div>
<div>I originally stumbled upon this when I was using the HtmlReadWriter to parse a piece of HTML that contained a nbsp in its CSS. That is perfectly valid HTML/CSS, but #<span>mapContainerTag: failed on it because #withBlanksTrimmed did not stripe away this
 nbsp. Yes, of course you could ask TextConverter or Unicode or whatever else in that place, but this feels like the wrong approach to me. Unicode awareness should be opt-in nowadays, not opt-out.</span></div>
<div><span><br>
</span></div>
<div><span>Best,</span></div>
<div><span>Christoph</span></div>
</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 12. Mai 2021 07:37:17<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] [ENH] isSeparator</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
This reminds me of our #asNumber (or number parser) discussion where we agreed to not parse number-like appearances in Unicode to Integer. :-)
<div><br>
</div>
<div>Instead of modifying CharacterSet etc., one could maybe extend TextConverter to support encoding-aware identification of separators etc and also provide encoding-aware #trim.</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 08.05.2021 04:12:21 schrieb Levente Uzonyi <leves@caesar.elte.hu>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">On Fri, 7 May 2021, Thiede, Christoph wrote:
<br>
<br>
> <br>
> Hi Levente, <br>
> <br>
> <br>
> thanks for the pointer. As far I can see from the linked discussion, Tobias' proposal has never been rejected but only postponed due to the upcoming release. I also see your point of performance, but IMHO correctness is more
<br>
> important than performance. If necessary, we could still hard-code the relevant code points into #isSeparator.
<br>
> <br>
> <br>
> > - consistency: CharacterSet separators would differ from the rest with your change set.
<br>
> <br>
> <br>
> Fair point, but I think we should instead fix the definitions of Character(Set) constants to respect the encoding as well ... By the way, Character alphabet and Character allCharacters also don't do this at the moment.
<br>
> <br>
> Of course, all your concerns are valid points and need to be discussed, but I would be sorry if we failed to - finally - establish current standards in our Character library. I doubt that any modern parser for JSON or
<br>
> whatever would treat Unicode space characters incorrectly, and still, they are satisfyingly fast. I think we should be able to keep pace with them in Squeak as well. :-)
<br>
<br>
Well, you ignored my question "What is a separator?". <br>
IMO a separator is a whitespace that separates tokens in the source <br>
code. <br>
Would you like to use zero-width space as a separator? Not likely. <br>
#isSeparator is deeply buried into the system. Changing it would mean <br>
changing other code your changeset doesn't touch, e.g. the parsers. <br>
<br>
The method you propose is welcome, but IMO it shouldn't be called <br>
#isSeparator. #isWhitespace is a much better fit. <br>
<br>
<br>
Levente <br>
<br>
> <br>
> Best, <br>
> Christoph <br>
> <br>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org>im Auftrag von Levente Uzonyi
<leves@caesar.elte.hu><br>
> Gesendet: Freitag, 7. Mai 2021 22:01:18 <br>
> An: The general-purpose Squeak developers list <br>
> Betreff: Re: [squeak-dev] [ENH] isSeparator   <br>
> Hi Christoph, <br>
> <br>
> There was a discussion on this subject before: <br>
> http://forum.world.st/The-Trunk-Collections-topa-806-mcz-td5084658.html <br>
> Main concerns are <br>
> - definition: What is a separator? <br>
> - consistency: CharacterSet separators would differ from the rest with <br>
> your change set. <br>
> - performance: I haven't measured it, but I wouldn't be surprised if <br>
> #isSeparator would become a magnitude slower with that implementation. <br>
> <br>
> <br>
> Levente <br>
> <br>
> On Thu, 6 May 2021, christoph.thiede@student.hpi.uni-potsdam.de wrote: <br>
> <br>
> > Hi all, <br>
> > <br>
> > here is one tiny changeset for you: isSeparator.cs adds proper encoding-aware support for testing of separator chars. As opposed to the former implementation, non-ASCII characters such as the no-break space (U+00A0) will be
<br>
> identified correctly now, too. <br>
> > <br>
> > Please review and merge! :-) <br>
> > <br>
> > Best, <br>
> > Christoph <br>
> > <br>
> > ["isSeparator.cs.gz"] <br>
> <br>
> <br>
><br>
</leves@caesar.elte.hu></squeak-dev-bounces@lists.squeakfoundation.org></div>
</blockquote>
</div>
</div>
</body>
</html>