chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 280 forks source link

WindowOptions.Title does not support chinese on osx #295

Closed liesauer closed 3 years ago

liesauer commented 3 years ago
var config = DefaultConfiguration.CreateForRuntimePlatform();
config.WindowOptions.Title = "测试";

on osx image

on windows, it is fine. image

mattkol commented 3 years ago

@liesauer

Will verbatim work?

var config = DefaultConfiguration.CreateForRuntimePlatform();
config.WindowOptions.Title = @"测试";
liesauer commented 3 years ago

no

here's my code

var config = DefaultConfiguration.CreateForRuntimePlatform();
config.CefDownloadOptions.AutoDownloadWhenMissing = false;
config.WindowOptions.Title = "测试";
config.WindowOptions.RelativePathToIconFile = "favicon.ico";

var appDirectory = AppDomain.CurrentDomain.BaseDirectory;
config.StartUrl = $"file:///{appDirectory}web/index.html";

var appBuilder = AppBuilder
.Create()
.UseConfig<DefaultConfiguration>(config)
.UseApp<HybridApp>()
.Build();

appBuilder.Run(args);
mattkol commented 3 years ago

Did you try the "@" in front of the title? Try change "测试" to @"测试".

liesauer commented 3 years ago

Did you try the "@" in front of the title? Try change "测试" to @"测试".

doesn't work.

mattkol commented 3 years ago

Seems like a disconnect between .NET/C# and Cocoa/Objective-C. It will require looking at how Cocoa/Objective-C handles encoding.

mattkol commented 3 years ago

@liesauer

This is now fixed.

Fix_issue_295 Fix_issue_295_2

liesauer commented 3 years ago

thanks!