Problems with encoding UTF-8 in Powershell
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- powershell
- Área
- tooling
Línea de trabajo
Start with PowershellSyntax.sublime-settings and reproduce the UTF-8 and UTF-8 with BOM behavior on Windows with the UTF-8 beta feature disabled. Check the related build-panel behavior and the effect of running chcp.exe; done means an agreed encoding behavior is validated for the affected PowerShell and build workflows, including the compatibility concern for Linux and PowerShell Core users.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Per default Windows 10 and Windows 11 do not use UTF-8 unless you manually enable as a Beta feature under Region Settings in intl.cpl
Without that setting enabled both Sublime and Powershell are having problems reading and displaying special characters such as "åäö".
Here is an example below on a machine without UTF-8 enabled running files from the Powershell console.
File encoding: UTF-8

File encoding: UTF-8 with BOM
As you can see Powershell is unable read the string when the file encoding is "UTF-8" and everything works fine when the encoding is set to "UTF-8 with BOM".
Here is another example with the Build Panel is Sublime Text
File encoding: UTF-8
File encoding: UTF-8 with BOM
As you can see the output is still wrong in the Build Panel even when the encoding is set to "UTF-8 with BOM". But it can be fixed by running chcp.exe in cmd

And then changing the encoding settings in the build job.

As stated before this is only an issue when the UTF-8 Beta feature in Windows is disabled. If you enable UTF-8 support the Sublime Text build panel and powershell console works without any issues.
I am not sure how to handle the build panel problem but at least changing the default encoding format for Powershell files to "UTF-8 with BOM" would prevent scripts processing special characters from causing unwanted bugs. This could probably be done by updating PowershellSyntax.sublime-settings with "default_encoding": "UTF-8 with BOM". But I am not sure how that would affect Linux or Powershell Core users.
- Lenguaje dominante
- PowerShell
- Estrellas
- 335
- Forks
- 80
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SublimeText/PowerShell
-
tooling
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
SublimeText/PowerShell#226 ·
-
syntax
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
SublimeText/PowerShell#218 · 1 comentario ·
-
Fully conform to Parsing rules Abiertosyntax
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
SublimeText/PowerShell#211 ·
-
build system
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
SublimeText/PowerShell#167 · 2 comentarios ·
-
Add Snippet for Documentation Abiertoautocomplete
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
SublimeText/PowerShell#82 · 6 comentarios ·
Todos los issues de SublimeText/PowerShell
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
danielmiessler/LifeOS#2218 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
googleapis/librarian#7636 ·