Page 1 of 1

Replace ° character through blank character

Posted: Sun Nov 21, 2010 10:27 am
by j&b
When I copy text from internet, it happens that I get this character ° at the end of a (winword) paragraph.
It does not correspond to ° (of the ^ ° - key) (this ° is smaller than the ° at then end of a paragraph).
Do you know a code is to replace ° through a space (or something else) ?

I think ° corresponds to ALT+0176 of Times New Roman.

Posted: Sun Nov 21, 2010 7:37 pm
by Sergey Tkachenko
Please give me a link from where you copied.
Browser? Delphi version?

Posted: Mon Nov 22, 2010 3:18 pm
by Sergey Tkachenko
I received your email.
These characters are non-breaking spaces. They are displayed exactly like normal spaces. Circles are displayed only in "show-spacial-characters" mode.
Details are sent by email.

Posted: Mon Nov 22, 2010 4:42 pm
by j&b
Sergey Tkachenko wrote:I received your email.
These characters are non-breaking spaces. They are displayed exactly like normal spaces. Circles are displayed only in "show-spacial-characters" mode.
Details are sent by email.
From Sergey:
As I can see, this character is a non-breaking space. It looks exactly like a normal space, the only difference is that text cannot be wrapped on this space.
A circle that you can see is not this character, it is a special mark that is used to display non-breaking spaces in the "show special characters" mode, just like a small dot for normal spaces, or arrow for tabs.

If you want to replace these characters to spaces as an editing procedure, the simplest way is using SearchText for searching for #$A0 character, and InsertText to insert space in its place.

Thanks, problem solved:

procedure TForm1.nonBreakingSpaceClick(Sender: TObject);
begin
RVSetLinearCaretPos(memo,0); //rd -> TReplaceDialog
rd.FindText := #$A0; rd.ReplaceText:= #32;
while Memo.SearchText(rd.FindText,GetRVESearchOptions(rd.Options)) do
Memo.InsertText(rd.ReplaceText,False);
end;