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

wide-char window classes are wrong #24

Open
Inve1951 opened this issue Dec 3, 2023 · 1 comment
Open

wide-char window classes are wrong #24

Inve1951 opened this issue Dec 3, 2023 · 1 comment

Comments

@Inve1951
Copy link

Inve1951 commented Dec 3, 2023

e.g.

zigwin32/win32/ui/controls.zig

Lines 1881 to 1886 in 6777f1d

pub const WC_STATICA = "Static";
pub const WC_STATICW = "Static";
pub const WC_STATIC = "Static";
pub const WC_EDITA = "Edit";
pub const WC_EDITW = "Edit";
pub const WC_EDIT = "Edit";

should be something like

pub const WC_STATICA = "Static";
pub const WC_STATICW = @import("../zig.zig").L(WC_STATICA);
pub const WC_EDITA = "Edit";
pub const WC_EDITW = @import("../zig.zig").L(WC_EDITA);

pub usingnamespace switch(@import("../zig.zig").unicode_mode) {
    .ansi => struct {
        pub const WC_STATIC = WC_STATICA;
        pub const WC_EDIT = WC_EDITA;
    },
    .wide => struct {
        pub const WC_STATIC = WC_STATICW;
        pub const WC_EDIT = WC_EDITW;
    },
    .unspecified => struct {
        pub const WC_STATIC = @compileError("'WC_STATIC' requires that UNICODE be set to true or false in the root module");
        pub const WC_EDIT = @compileError("'WC_EDIT' requires that UNICODE be set to true or false in the root module");
    },
};
@riverar
Copy link

riverar commented Jan 17, 2024

Heads up for @marler8997, encoding for strings in metadata is utf16 unless otherwise annotated

public const string WC_STATICW = "Static";

[NativeEncoding("ansi")]
public const string WC_STATICA = "Static";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants