vscode The character U+0647 "ه" could be confused with the character U+006f "o", which is more - visual-studio-code

vscode after update (November 2021 (version 1.63)) Unicode highlighting#
vscode highlight same persian words, I want add persian characters to allowed characters. but how?
Thank you if you can help me
"The character U+0647 "ه" could be confused with the character U+006f "o", which is more common in source code."

In the Editor > Unicode Highlight: Allowed Characters setting if you click on
Add Item you can paste or type your character in - but it appears you have to do it one by one which is sub-optimal. I tried inputting some unicode ranges but nothing worked.
I tested it for your ه character and it works. Once you paste it in, the value field will populate with true which is what you want.
The Ambiguous Characters setting shouldn't flag characters "common in the current user locale." Is ه such a character?
I don't see a Persian Language Pack in the Marketplace so perhaps there is no way to change your vscode language to Persian.
More on locales here: https://code.visualstudio.com/docs/getstarted/locales

You can also uncheck Settings > Editor > Unicode Highlight: Ambiguous Characters
It's so much easier than adding characters every single time.

Related

IN vs code the double quotes and single quotes are being flags as errors why?

Why is it that the double quotes are being picked up as an error and I can't even use contractions words either because they are getting flagged as a issue? This has never been a issue before so why is it starting now?
It may be that your language is not recognizing the fancy quotes as allowable string delimiters and so the red underlining under the strings mat be fixed by changing those fancy quotes to normal quotes.
As of vscode v1.63: Just to know what those orange borders around the quote marks are, the fancy quotes are unexpected unicode characters. Those orange borders are warnings that there are unexpected or ambiguous unicode characters.
If you add those fancy quote characters to this setting:
Editor > Unicode Highlight: Allowed Characters
Just copy and paste your varioucs characters, like ” into the Add Item input.
Or you can disable this setting:
Editor > Unicode Highlight: Non Basic ASCII
and those warning borders will go away.
Unicode Highlighting of certain features was added to vscode recently.

Fix issue With VS Code: yellow orange border box around characters

When I type a ا letter in the Arabic language it is surrounded with a colored border box in vscode.
Any solution to this problem?
Your specific case - a series of Arabic characters - might no longer be highlighted in vscode (even with the following settings enabled) as vscode is getting a little smarter about strings of characters it would otherwise highlight.
Contextual Unicode Highlighting
To report fewer false positives, ambiguous and invisible unicode
characters are no longer highlighted if the surrounding characters
visually indicate a non-ASCII script.
Thus, in trusted workspaces, only characters that are invisible or can
be confused with ASCII characters are highlighted, except those that
are contained in a word of non-ASCII characters where at least one
character cannot be confused with an ASCII character.
from v1.65 Release notes; contextual unicode highlighting
Try disabling one or more of these settings (set to false):
Editor > Unicode Highlight: Non Basic ASCII
Editor > Unicode Highlight: Ambiguous Characters
also see https://stackoverflow.com/a/70293571/836330 for more on the Unicode Highlighting options. And https://stackoverflow.com/a/70297896/836330 and https://github.com/microsoft/vscode/issues/138767.
There is also a way in vscode v1.64 to add another locale to your environment so that its characters will not be highlighted as questionable unicode characters.
New setting: Editor > Unicode Highlight: Allowed Locales
Use this when your display language is something other than the language you are using in your files, like French, Russian, Japanese, etc. that is causing the unwanted unicode warning highlights.
Download the language pack you need:
Search in the Extensions view for "language packs". I believe only the Microsoft language packs are supported in the Allowed Locales at this time. The picture above shows the French Language Pack. Install it.
Add its language code to the Allowed Locales setting.
To find the right "code", the easiest is to open your Command Palette after installing the language pack and search for Configure Display Language. You don't want to change your display language but it will show the available language codes:
We see we need fr as the code.
It will make a setting like this in your settings.json:
"editor.unicodeHighlight.allowedLocales": {
"fr": true
}
Before these changes:
After: In theory, with the default options for the other unicode highlight setting, the unicode highlighting should be gone.
[It still seems a little rough to me, you may have different results.]

How to find unicode characters that are not utf8 in VS Code?

I have unicode characters that I can't see, that are not utf8, I need to spot them.
I used the extension Highlight Bad Chars (Kevin Wenger) but it's not sufficient, in particular, I don't know which are these characters and I don't want to have to define them in advance.
How can I do this with VScode ?
Find [^\x00-\x7f] and Check use regular expressions.
Taken from Kon Blog
You can try the Gremlins extension which I found better than Highlight Bad Chars (Kevin Wenger) (at least, Gremlins worked out of the box; I couldn't get Highlight Bad Chars to highlight anything).
Also:
Gremlins Last updated: 11/5/2020
Highlight Bad Chars Last updated: 6/30/2018
In Stable Build v1.63 there is a new method for highlighting various unicode characters that might otherwise be difficult to spot in your code. These are the new settings:
You can use these colorCustomizations to change the default orange borders:
{
"workbench.colorCustomizations": {
"editorUnicodeHighlight.border": "#00ff37",
"editorUnicodeHighlight.background": "#f00", // will be in vscode v1.66
// "minimap.unicodeHighlight": "#ff0000", // removed in v1.64
// "editorOverviewRuler.unicodeForeground": "#ff0000" // removed in v1.64
}
Apparently, indicators for these unicode warnings will not be shown in the minimap or overview ruler as of v1.64, see Consider removing the unicode highlight scroll bar decoration
Here is how a unicode zero-width space appears with these settings:
The zero-width character is an invisible unicode character controlled by the Unicode Highlight: Invisible Characters setting above.
From v1.63 release notes: unicode highlighting
Read this article or this article for how invisible or confusable
Unicode characters can be used in Unicode spoofing attacks.
Note that this feature does not detect all possible Unicode spoofing
attacks, as this depends on your font and locale settings. Also, the
detection of ambiguous characters is done heuristically. To be on the
safe side, the restricted mode of the workspace trust should be used
to review source code, as all non-ASCII characters are highlighted in
untrusted workspaces.
The settings editor.unicodeHighlight.invisibleCharacters,
editor.unicodeHighlight.ambiguousCharacters or
editor.unicodeHighlight.nonBasicASCII can be set to false to disable
the corresponding feature.
Individual characters can be excluded from being highlighted and
characters in comments or text and markdown documents are not
highlighted by default.

How can I use the original unicode characters for the four card suits in a jupyter notebook?

If I copy and paste the four symbols from the character selection panel (I'm on macOS) they change to the following: ♠️ ♣️ ♥️ ♦️, whereas I'd like the heart and diamond to be red.
EDIT: Interestingly, i've noticed that if I type the sequence 👁‍🗨♥️, and then I hit backspace when the cursor is between those two characters, they both transform into 👁‍♥️! (the same happens with the other three)
Can someone explain what is happening?
I guess this is because your browser doesn't know about these special characters. But I think you can check this page https://www.w3schools.com/charsets/ref_utf_symbols.asp
and replace special characters with unicode codes from page
or from this page http://graphemica.com/%E2%9D%A4

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.