Skip to content
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

Chinese Characters in Logs Appear as Garbled Text in Console for ASP.NET Projects #6936

Open
1 task done
sangyuxiaowu opened this issue Dec 12, 2024 · 0 comments
Open
1 task done
Labels
area-dashboard area-telemetry untriaged New issue has not been triaged

Comments

@sangyuxiaowu
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When running an ASP.NET project using .NET Aspire, I have encountered an issue where Chinese characters in the logs appear as garbled text in the console. However, these characters are displayed correctly in the structured logs.

Image

Image

Expected Behavior

Chinese characters should be displayed correctly in the console output.

Steps To Reproduce

  1. Create a new ASP.NET project using .NET Aspire.
  2. Add logging for some operations, including messages with Chinese characters.
  3. Run the project and observe the console output.
  4. Compare the console output with the structured logs.
_logger.LogInformation("中文输出测试");

Exceptions (if any)

No response

.NET Version info

.NET SDK:
Version: 9.0.101
Commit: eedb237549
Workload version: 9.0.100-manifests.4a280210
MSBuild version: 17.12.12+1cce77968

运行时环境:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.101\

已安装 .NET 工作负载:
[maui-windows]
安装源文件: VS 17.12.35527.113
清单版本: 9.0.0/9.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
安装类型: Msi

[maccatalyst]
安装源文件: VS 17.12.35527.113
清单版本: 18.1.9163/9.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.1.9163\WorkloadManifest.json
安装类型: Msi

[ios]
安装源文件: VS 17.12.35527.113
清单版本: 18.1.9163/9.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.1.9163\WorkloadManifest.json
安装类型: Msi

[aspire]
安装源文件: VS 17.12.35527.113
清单版本: 8.2.2/8.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
安装类型: Msi

[android]
安装源文件: VS 17.12.35527.113
清单版本: 35.0.7/9.0.100
清单路径: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.7\WorkloadManifest.json
安装类型: Msi

配置为在安装新清单时使用 loose manifests。

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

.NET SDKs installed:
9.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Anything else?

No response

@joperezr joperezr added untriaged New issue has not been triaged area-telemetry area-dashboard labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dashboard area-telemetry untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

2 participants