Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

tagToInt

This function is specific to how the Win32 RC command line interprets language tags: invalid tags are rejected, but tags that don't have a specific assigned ID but are otherwise valid enough will get converted to an ID of LOCALE_CUSTOM_UNSPECIFIED.

lang.tagToInt
pub fn tagToInt(tag: []const u8) error

File

Code

pub fn tagToInt(tag: []const u8) error{InvalidLanguageTag}!u16 {
    const maybe_id = try tagToId(tag);
    if (maybe_id) |id| {
        return @backingInt(id);
    } else {
        return LOCALE_CUSTOM_UNSPECIFIED;
    }
}