Replace ° character through blank character

General TRichView support forum. Please post your questions here
Post Reply
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

Replace ° character through blank character

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please give me a link from where you copied.
Browser? Delphi version?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

Post 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;
Post Reply