Unexpected match when searching files for an end-quote character (non-ASCII)
-
Fellow Notepad++ Users,
Could you please help me with the following search~~-and-replace~~ problem I am having?
The text is from a Perl script I wrote long ago. Notepad++ identifies the file as “ANSI” and it appears to be encoded as Windows-1254, although Notepad++ doesn’t identify it as such.
Here is the data I currently have (“before” data):
binmode STDOUT, ':utf8'; print "Çirçös\n";Here is how I would like that data to look (“after” data):
This match was found by a file search. I didn't expect that the ″ character would be found in this file.
To accomplish this, I have tried using the following Find/Replace expressions and settings
- Find What =
″ - Replace With =
- Search Mode = NORMAL
- Dot Matches Newline = CHECKED
Unfortunately, this did not produce the output I desired, and I’m not sure why. Could you please help me understand what went wrong and help me find the solution?
- Find What =
-
@Freon-Sandoz said in Unexpected match when searching files for an end-quote character (non-ASCII):
The text is from a Perl script I wrote long ago. Notepad++ identifies the file as “ANSI” and it appears to be encoded as Windows-1254, although Notepad++ doesn’t identify it as such.
When Notepad++ opens a file as ANSI, it is using the default code page for your system. Is the default code page for your system Windows-1254? (One way to tell would be to copy the Debug Info… from the ? menu. Among other useful diagnostic information, it lists the Current ANSI codepage.)
If your code page is not 1254, then try opening the file in Notepad++ and immediately — before you do anything else! — select Encoding | Character sets | Turkish | Windows-1254. That will cause Notepad++ to reload the file and interpret it using the specified code page.
I’m not convinced that is the problem, though. In the screen shot you included, the quotes look like straight quotes, not typographic quotes. You’ve highlighted the quote mark, but that appears to be just your selection, not the result of a search; I think the search you show in that screen shot will not (and should not) match.
So I think it’s more likely that the problem lies in whatever led you to think that there is a non-ASCII end quote in the file. You say you didn’t expect a curly quote and it looks like you don’t have one. What sort of file search did you do that led you to think there was one?