Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » IsSpace() should be true on non breaking space
Re: IsSpace() should be true on non breaking space [message #52802 is a reply to message #52797] Fri, 29 November 2019 09:59 Go to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
zsolt wrote on Thu, 28 November 2019 01:40
I think, non breaking space character (0xa0) is space.

Proposed patch (Core/CharSet.h):
-inline bool IsSpace(int c)         { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t'; }
+inline bool IsSpace(int c)         { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t' || c == 0xa0; }


You can test it with an EditString
someedit.SetFilter(CharFilterNotWhitespace);


And try typing 0160 on numpad while holding down Alt key.
Some users can be tricky.


I disagree for two reasons:

1) traditional isspace does not treat it as space http://www.cplusplus.com/reference/cctype/isspace/
2) in most text algorithms, hard space is actually treated as non-space - that in fact is its basic purpose...
 
Read Message
Read Message
Previous Topic: [solved] CParser GetColumn bugfix
Next Topic: AMap::Trim(int n)
Goto Forum:
  


Current Time: Mon Jun 09 22:08:44 CEST 2025

Total time taken to generate the page: 0.03542 seconds