简体   繁体   中英

How do I set locale on Mac OS X platforms?

I'm using Azure-DevOps Server pipeline to compile an IOS application with an IOS agent (macOS Big Sur) while using Xcpretty for tests and code coverage reports. The Xcpretty not working:

/Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty/parser.rb:434:in ===': invalid byte sequence in US-ASCII (ArgumentError) from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty/parser.rb:434:in update_test_state' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty/parser.rb:307:in parse' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty/formatters/formatter.rb:88:in pretty_format' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/lib/xcpretty/printer.rb:19:in pretty_print' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:84:in block in <top (required)>' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:83:in each_line' from /Library/Ruby/Gems/2.6.0/gems/xcpretty-0.3.0/bin/xcpretty:83:in <top (required)>' from /usr/local/bin/xcpretty:23:in load' from /usr/local/bin/xcpretty:23:in '

Everybody on google says that all I've got to do is to change my locale with the bash command:

export LANG=en_US.UTF-8

export LC_ALL=en_US.UTF-8

and it not working, I think that the problem is that this export is per terminal and not global, if I put this command on bash and print "locale" I got: This

If I use the export commands: This

And after opening a new terminal: Again.

Any idea to change it globally?

What I did to change my locale configuration was the following:

In the root of your user on Mac you edit the file .bash_rc or .zshrc , depending on the shell you use.

nano.bash_rc or nano.zshrc

and inside the file you write the commands that have been suggested to you:

    export LANG="en_US.UTF-8"
    export LC_ALL="en_US.UTF-8"

You save changes and exit the editor.

Then you run the command:

source.bash_rc or source.zshrc

then you check that the changes have been made with the following command:

date

That's all, Now You have the date and time in the correct format!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM