\u0119 to ę in notepad++ - unicode

I have searched all over the Internet for an answer. I have achieved this once before, but I can't remember how I did this...
I have a long text file with alot of encoded characters, for example
\u0119,\u015b\\u0107
How do I change characters like \u0119 to ę, etc?

This question is not off-topic. In past I also use notepad++ for programing. Today i use Atom. You can find a lot questions about notepad++ in stack overflow - for instance: Removing duplicate rows in Notepad++ or this Convert tabs to spaces in Notepad++ (and many more). So please do not give minus points to this question.
Answer: I assume that when you go to menu>Encoding you will see 'Encde in UTF-8.'
I use this site to create part of my answer: https://superuser.com/questions/576431/notepad-inserting-special-unicode-characters-in-utf-8
If you see character codes like \u0119,\u015b\u0107 in your file this probably mean that they are just on encoded - and their codes are put expliicty as raw text.
So to change this codes into UTF-8 characters, go to
menu>run>run> type: charmap> click run
the windows charmap will show up, so check ''advanced view' an there put you character code (without \u prefix - so for instance only 0119) in filed 'go to Unicode'. Then click on 'select' and 'copy' and close window
Then go to menu>search>replace and in filed 'replece with' past you character, and inf filed 'find what' put its code (with prefix, for instance \u0119). And click 'Replace All'
Do steps 1-3 for each character code (you can check thad your done when you click menu>find> and type '\u' in "find what". If you not find any code then you job is end.

Related

How to convert embedded CRLF codes to their REAL newlines in Vscode?

I searched everywhere for this, the problem is that the search criteria is very similar to other questions.
The issue I have is that file (script actually) is embedded in another file. So when I open the parent file I can see the script as massive string with several \n and \r\n codes. I need a way to convert these codes to what they should be so that it formats the code correctly then I can read said code and work on it.
Quick snippet:
\n\n\n\n\nlocal scriptingFunctions\n\n\n\n\nlocal measuringCircles = {}\r\nlocal isCurrentlyCheckingCoherency
Should covert to:
local scriptingFunctions
local measuringCircles = {}
local isCurrentlyCheckingCoherency
perform a Regex Find-Replace
Find: (\\r)?\\n
Replace: \n
If you don't need to reconvert from newlines to \n after you're done working on the code, you can accomplish the trick by simply pressing ctrl-f and substituting every occurrence of \n with a new line (you can type enter in the replace box by pressing ctrl-enter or shift-enter).
See an example ctrl-f to do this:
If after you're done working on the code you need to reconvert to \n, you can add an invisible char to the replace string (typing it like ctrl-enter invisibleChar), and after you're done you can re-replace it with \n.
There's plenty of invisible chars, but I'd personally suggest [U+200b] (you can copy it from here); another good one is [U+2800] (⠀), as it renders as a normal whitespace, and thus is noticeable.
A thing to notice is that recent versions of vscode will show a highlight around invisible chars, but you can easily disable it by clicking on Adjust settings and then selecting Exclude from being highlighted.
If you need to reenable highlighting in the future, you'll have to look for "editor.unicodeHighlight.allowedCharacters" in the settings.

Entering accented characters with notepad++ using only the keyboard

I am new to notepad++ and like it very much, since I can customize how my text documents look more easily than with wordpad. However, I would like to know if it’s possible to enter accented characters like in wordpad (I thought it was a windows thing, but perhaps it isn’t). In wordpad, I can type, for instance, ctrl-’ then i to get an accented í character. Similarly, I can type ctrl-shift-~ then n to get the accented ñ character. It makes it much easier to enter accented characters than copying and pasting from the character map application, or trying to remember code points. When I tried this method in notepad++ I just got the plain character without the accents. I should also mention that when I open documents with such accented characters already present they appear just as expected. Is there a way to enter accented characters like this in notepad++ using only the keyboard? I am using the latest notepad++ under Windows 7.
In Notepad++ you can go to “Edit” then select “Character Panel” near the bottom of the drop down menu. It will show you the ASCII set available which includes most accented characters. You find the character you want and there will be a number for it, to easily use that, press and hold your ALT key, then, on your keypad on the right side of your keyboard type zero followed by the number for that character. So for something like “ñ” for example, the code for it is 241, so you would press ALT and then type 0241 on the keypad while holding down ALT and you will get the character you need. That works in most Windows programs, even in here.
This only works for ASCII characters in the range of 0 to 255. I don't know of a method other than copying and pasting from the “Character Map” app available in Windows for Unicode. Though I did test Wordpad with the Decimal number of the Hex value you see for a Unicode character above 255 and it will work with the ALT+#### in there, and probably other places, but it doesn't work in Notepad or Notepad++ for some strange reason, sadly. Two I use a lot and have memorized are ALT+0147 and ALT+0148 for the quotation marks “like these”, so once you use the numbers enough you tend to get used to them, or you can jot down the ones you use the most.
For anyone searching for a solution and coming across this page, try this (Windows): install and use the US International keyboard instead of the plain US keyboard. Search for "windows keyboard us international install" or something similar. I liked the techlanguage.com write-up on it and the teckangaroo.com step by step on how to install. Hope this helps someone in future looking around as I was earlier today for how to easily meet this need.
You can make your own keyboard layout to enter arbitrary characters anywhere in Windows, using MSKLC. Here's one I made earlier.
I think it is configured in the input method. With input method containing the characters you mentioned, you can press key combinations to get special letters.
You can add a keyboard layout preset in Windows. Under "Language and Regions" - "Language" - "Language settings" - "Input method" settings in Control Panel, you can add all what you want. Like this:
Switch keyboard layout with Alt + Shift.

Replacing a string in Rubymine with a string with newlines

I want to use the Search and Replace dialogue in Rubymine, or something similar to replace something like "Scenario:" with "#Desktop\nScenario"
I'm trying to replace every instance of Scenario: in a large Cucumber test suite with
#desktop
Scenario:
Any best ways to do this?
Update:
Thanks to #ryan2johnson9 comment, I realise there's now an easier option (tested on 2017.3).
By clicking on the "New Line" (or using the shortcut Ctrl+Shift+Enter / Alt+Enter), the input becomes multilines.
Original Answer
In the search and replace box, if you tick the "Regex" option you can do:
Search: "Scenario:"
Replace by: "#desktop\nScenario:"
The only trick is to tick the "Regex" option :)
Rubymine has macros (http://www.jetbrains.com/ruby/webhelp/binding-macros-with-keyboard-shortcuts.html) but I dont think they are powerful enough for this example.
It's possible that you could solve it with some elaborate feature hidden inside Rubymine, but I think it would be a lot easier to do this with a tool like perl/sed from the Terminal. If you are using Windows I assume you could search the net and find a text search/replace tool that fits your need.
In OSX I there are a bunch of Text Substitutions app too.
I would go that route since Rubymines macro tool isnt up to the task.
Here's a cheap and sleazy alternative:
Copy a newline character from between two empty lines in the file being edited. Temporarily add two empty lines if you don't have any.
Set up search/replace and enter the string you want to replace into the search text input box.
Paste the newline you just copied into the replacement text box plus whatever other text you want. You will be able to see the height of the replacement text input box grow vertically by one line due to the newline.
Perform the search/replace.
For this, the use of the Rubymine regex is optional.

Simple eclipse search problem

I use the eclipse File Search option very much to search all files in my workspace for a certain content. But how do I specify that it should only return hits from a fixed search criteria? As an example I would like to find all occurrences of the string:
com.mystuff.data
but I also get all the hits for:
com.mystuff.data.ui
How do I make a "this-string-only-search" when searching files in my workspace??
If I understand you correctly, Eclipse don't provide option to search exact word.
You can use regular expression for it.
You can use \bSearchKeyword\b to find exact word.
I suggest that you use regular expressions.
Here are the steps:
Select the checkbox "Regular expression" which is located beside the "Containing text" field.
In the "Containing text" field write: com.mystuff.data\D\W
Note that:
\D means "no digit"
\W means "no alphanumeric"
In case you would like to refine the regular expression, click Ctrl-SPACE, in order to get the regular expression assistance.
Hope this helps.
Best regards
Maybe slightly off-topic but this got me tripped and brought me here - maybe useful for somebody else:
In the Eclipse standard Find/Replace dialogue the section 'Options' (that includes the option 'Whole Word') may be hidden if the Find/Replace dialogue window was previously resized to a smaller size, without any clue to its presence. Resizing it larger brings back the options section. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355206
and attached shots.
Eclipse standard Find/Replace dialogue search for Whole Word regards several characters (including period) besides a space as a word delimiter, so you indeed cannot distinguish between "com.mystuff.data" and "com.mystuff.data.ui"
E.g. search 'Stack' with option 'Whole Word' checked:
will match:
Stack
Stack overflow
Stack.overflow
Stack,overflow
Stack[overflow]
Stack(overflow)
Stack-overflow
Stack/overflow
will not match:
Stackoverflow
Stack2overflow
Stack_overflow
Simplest way is to add space in the start and end of your search term.
Try SHFT+ CTRL+R, then on right upper angle select Working Set, then name and specify your resources.
Create Work Set as above, then CTRL+H check checkbox All occurency, then select your Work Set. Or maybe you can create work set in CTRL+H.

How can I clean source code files of invisible characters?

I have a bizarre problem: Somewhere in my HTML/PHP code there's a hidden, invisible character that I can't seem to get rid of. By copying it from Firebug and converting it I identified it as  or 'Zero width no-break space'. It shows up as non-empty text node in my website and is causing a serious layout problem.
The problem is, I can't get rid of it. I can't see it in my files even when turning Invisibles on (duh). I can't seem to find it, no search tool seems to pick up on it. I rewrote my code around where it could be, but it seems to be somewhere deeper in one of the framework files.
How can I find characters by charcode across files or something like that? I'm open to different tools, but they have to work on Mac OS X.
You don't get the character in the editor, because you can't find it in text editors. #FEFF or #FFFE are so-called byte-order marks. They are a Microsoft invention to tell in a Unicode file, in which order multi-byte characters are stored.
To get rid of it, tell your editor to save the file either as ANSI/ISO-8859 or as Unicode without BOM. If your editor can't do so, you'll either have to switch editors (sadly) or use some kind of truncation tool like, e.g., a hex editor that allows you to see how the file really looks.
On googling, it seems, that TextWrangler has a "UTF-8, no BOM" mode. Otherwise, if you're comfortable with the terminal, you can use Vim:
:set nobomb
and save the file. Presto!
The characters are always the very first in a text file. Editors with support for the BOM will not, as I mentioned, show it to you at all.
If you are using Textmate and the problem is in a UTF-8 file:
Open the file
File > Re-open with encoding > ISO-8859-1 (Latin1)
You should be able to see and remove the first character in file
File > Save
File > Re-open with encoding > UTF8
File > Save
It works for me every time.
It's a byte-order mark. Under Mac OS X: open terminal window, go to your sources and type:
grep -rn $'\xFEFF' *
It will show you the line numbers and filenames containing BOM.
In Notepad++, there is an option to show all characters. From the top menu:
View -> Show Symbol -> Show All Characters
I'm not a Mac user, but my general advice would be: when all else fails, use a hex editor. Very useful in such cases.
See "Comparison of hex editors" in WikiPedia.
I know it is a little late to answer to this question, but I am adding how to change encoding in Visual Studio, hope it will be helpfull for someone who will be reading this sometime:
Go to File -> Save (your filename) as...
And in File Explorer window, select small arrow next to the Save button -> click Save with Encoding...
Click Yes (on Do you want to replace existing file dialog)
And finally select e.g. Unicode (UTF-8 without signature) - that removes BOM