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

Hard coded string caused crash in non-English locale #51

Open
hongwen000 opened this issue Aug 30, 2021 · 4 comments
Open

Hard coded string caused crash in non-English locale #51

hongwen000 opened this issue Aug 30, 2021 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@hongwen000
Copy link

In src/HandyWinget/Common/Helper.cs, line 314; "Name" string is hard coded, however, winget process does not always return "Name" as the header. Instead, its output depends on locale.

            try
            {
                string input = _wingetData.Substring(_wingetData.IndexOf("Name"));
                var lines = input.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Skip(2);
                return lines;

            }
@hongwen000
Copy link
Author

hongwen000 commented Aug 30, 2021

Same problems occur in functions for installing/uninstalling applications. Would this project be kind to support non-English locale? (This might be done by importing localization files from winget source code).

@ghost1372 ghost1372 added enhancement New feature or request bug Something isn't working labels Aug 30, 2021
@ghost1372
Copy link
Member

Thank you. There is currently no better way to identify installed apps and we have to use substring. I will try to support other languages as well

@hongwen000
Copy link
Author

Thanks for your great work, I think substring with an additional translating function will be fine. I would like to try it when I'm done with my work at hand!

@ghost1372
Copy link
Member

Using the translation method is the last way, we must look for a better way to parse data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants