VS Code can't read unicode language written in other editors - utf-8

I'm trying to use VS Code but I'm having a problem opening code written with other editors, VS Code can't read korean language unicode? utf-8? what we call other languages in code?
I wrote the code with vim editor with some comment written in korean, and any other editors can read korean languagee but VS Code like following.
ret.insert(ret.end(), bottom.begin(), bottom.end()); // written in vim
// 는 다음과 같음
ret.insert(ret.end(), bottom.begin(), bottom.end()); // opened in VS Code
// �� ������ ����
How can I fix this problem?

Make sure your VSCode is opening the file with UTF8 encoding.
Change the encoding of a file in Visual Studio Code

Related

Enable HTML-snippets for editing RHTML in Rstudio

Is it possible to use Rstudios build in HTML-snippets when editing RHTML-files in Rstudio?
When I open an RHTML-file the language is set to RHTML, as in the picture below:
But the HTML-snippets do not work for this language, and I can't see a way to enable RHTML as a language in the snippets menu.
The HTML-snippets work if I change the language to HTML, instead of RHTML, but then the R-functionality does not work anymore.
Any ideas to get HTML-snippets to work in a RHTML-file in Rstudio?
Using Rstudio Version 1.2.5033
Answer:
Use <shift> <tab> to insert HTHL-code snippets in RHTML.
<tab> alone does not work, when the language is set to RTML.
This is hinted at here:
https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets

Do all Windows fonts express extended ASCII in the same way?

In my Visual Studio 2012 application, I just wrote the following:
_snprintf_s(page[row++], NUM_COLS, _TRUNCATE, " Lat: %-11s (\x0b1 %3.1fm)",
lat_string, lat_precision_meters);
The \xb1 is the escape code for the "+/-" symbol, 177 in extended ASCII, ISO 8859.
I read that this was originally a Windows feature with some other name.
This works for me - it shows the correct symbol next to the precision, in my default font.
My question is: have I just introduced an issue for users who override the default font? Are all Microsoft-provisioned fonts ISO 8859-1 compliant?

How to config visual studio to use UTF-8 as the default encoding for all projects?

I did the search, but only found ways to change the encoding for individual files. I want to start projects with the encoding already configured as UTF-8.
I found two ways
Alternate
There is alternate way, please try it
Tools->Options->Environment->Documents
The last
If that can't you can try to save it as UTF-8, you can save as with advanced options
Visual Studio supports EditorConfig files (https://editorconfig.org/)
Visual Studio (VS2017 and later) searches for a file named '.editorconfig' in the directory containing your source files, or anywhere above this directory in the hierarchy. This file can be used to direct the editor to use utf-8. I use the following:
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
The [*] line is a mask and means for all files - the scope of the commands can be reduced using e.g. [*.{h,cpp}]
There are further possibilities, particularly for C# files. Full details can be found at https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2019
It's possible to set the locale code page to 65001, and VS will save all files with utf-8.
https://en.wikipedia.org/wiki/Unicode_in_Microsoft_Windows#UTF-8
But since it's a beta function, there will be some bugs.
also reference https://superuser.com/questions/1033088/is-it-possible-to-set-locale-of-a-windows-application-to-utf-8/1451686
Tools->Options->Text Editor->General

Special icon characters 💊 in Android Studio

In xcode it's possible to have characters like "💊" in code. If I paste it to Android Studio it shows me another 2 unicode characters, which don't have anything in common with "💊".
Both editors use UTF-8 encoding AFAIK.
So where is the difference?
Android Studio uses windows-1252 as default and you can use the unicode equivalent:
\uD83D\uDC8A
for example using a TextView:
myTextView.setText("\uD83D\uDC8A");
will create something like (in my device two pills are showed):
Here you can find the equivalent "Java Escape" code :
http://www.charbase.com/1f48a-unicode-pill

Word 2003 template with VBA macros that does not run properly in Word 2011 for MAC

As the title says, I've got a word template with macros that does not run properly in the new Word version from Office 2011 for MAC.
The thing which seems to not work properly is the following code:
Sub Document_New()
myForm.Show
End Sub
The same is with Document_Open()
It doesn't seem to run this code on the Mac version.
Does anyone know why this won't work on the Mac, or if there's another way around to emulate the document_open/document_new function?
EDIT: The document is in the .dot format. And I tried to save it to .doc, then the Document_open() worked just fine, so it seems to not be working in the .dot format.. And Document_New() is not running in .doc since its not a new templatefile based on a document..
EDIT 2: Seems like it was a once only with the Document_open on .doc files. I cant make it work again. So weird! The only event I get working, and this is only when using the .doc file format, is Document_Close() - this works everytime...
EDIT 3: This is just getting weirder. I made a new .doc document with the following code:
Private Sub Document_Open()
MsgBox ("BlaBlaBla")
End Sub
The code only runs if the Visual Basic Editor is open BEFORE I close the word file and try to open it again. If I close the Visual Basic Editor and then the word file, and then open the word file; The code is not run.
??
All VB application events are suppressed if you have the VB-editor active, and the current project is not running. It is an intentional behavior, to prevent unwanted code execution, hence not debuggable.
I have used Workbook_Open() (in Excel), and I can only see it working on newly open Excel Xls (xlsm on 2010), from a non-open VB-editor Excel application.
It will work if you have other doc/xls already open, but not if vb-editor is up.
Have you checked whether Macros are allowed? Do you have generated a certificate and setup your application as a trusted source?
I'm having similar issues. It seems that MS removed support for the Document_New and Document_Open functions in the Word object model for Word 2011. See http://mac2.microsoft.com/vb/1033/Word/html/womscChangesBetweenWord2010and2011.htm

Resources