-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unicode Highlight" feature suggests incorrect locale for ignoring common characters #189224
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.80.2. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
Reproduces on 1.80.2 as well |
Looks like the culprit is the assumption that people only ever use vscode with localization set to their native language and don't ever have to type anything in any other language :) Which leads to https://github.com/hediet/vscode-unicode-data/blob/main/index.ts#L131 only exporting data for locales supported by vscode/src/vs/base/common/strings.ts Line 1092 in 9a28101
|
same above problem,
The following are examples of testing the equality of these two strings in several common programming languages: // JavaScript
const str1 = "pcs\u53d8\u6d41\u5668";
const str2 = "pcs变流器";
console.log(str1 === str2); // output: true # Python
str1 = "pcs\u53d8\u6d41\u5668"
str2 = "pcs变流器"
print(str1 == str2) # output: True // Java
public class StringComparisonExample {
public static void main(String[] args) {
String str1 = "pcs\u53d8\u6d41\u5668";
String str2 = "pcs变流器";
System.out.println(str1.equals(str2)); // output: true
}
} // Csharp
using System;
class StringComparisonExample
{
static void Main()
{
string str1 = "pcs\u53d8\u6d41\u5668";
string str2 = "pcs变流器";
Console.WriteLine(str1 == str2); // output: True
}
} These examples test the equality of these two strings in different programming languages and output the results. Based on these examples, it can be seen that these two strings are considered equal in various programming languages.
|
In most programming languages, these two strings are exactly equal when compared. Whether you use Unicode-encoded escaped characters to represent Chinese characters, or you use UTF-8 encoded Chinese characters directly, they are treated as the same string when compared. |
// GO
package main
import "fmt"
func main() {
str1 := "pcs变流器"
str2 := "pcs\u53d8\u6d41\u5668"
fmt.Println(str1 == str2) // output: true
} // Rust
fn main() {
let str1 = "pcs变流器";
let str2 = "pcs\u{53d8}\u{6d41}\u{5668}";
println!("{}", str1 == str2); // output: true
} // C
#include <stdio.h>
#include <string.h>
int main() {
char str1[] = "pcs变流器";
char str2[] = "pcs\u53d8\u6d41\u5668";
if (strcmp(str1, str2) == 0) {
printf("Strings are equal\n"); // output: Strings are equal
} else {
printf("Strings are not equal\n");
}
return 0;
} |
that problem also alike in |
Sorry, @image72 , I think yours is a separate issue. Mine is about incorrect locale detection in UnicodeHighlight specifically. Yours seems to be about treatment of Unicode and/or decoding Unicode escape sequences in the UI in general |
Type: Bug
"росія - держава-терорист"
in an open code fileIn the popup it suggests to ignore characters common for "ru" locale, despite it not being used anywhere in the system. Moreover, manually specifying "uk" or "ua" locale in settings has no effect at all.
VS Code version: Code 1.80.1 (74f6148, 2023-07-12T17:22:07.651Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.1.0-1-amd64
Remote OS version: Linux x64 6.1.0-1-amd64
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (19)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: