Search code examples
macosionic-frameworkapple-m1capacitor

How to get the mac terminal to be using UTF-8 encoding on the new macs?


i have searched other answers to this question and they all say to edit the .zshrc or .profile files however these do not exist on my system even with hidden files shown.

I have a feeling there is a different solution for the new M1 macs, maybe these files have a new location

trying to run a pod install on an ionic capacitor project and receiving this error:

 WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:

export LANG=en_US.UTF-8 

does anyone have an idea?

thank you in advance!

nb ive been on this problem for two days


Solution

  • .zshrc and .profile only exist if someone creates them. You do that in Terminal with

    touch ~/.zshrc
    touch ~/.profile
    

    Check what shell you are using. In Terminal

    echo $SHELL
    

    It is recommended to use the Z shell, you change this with

    chsh -s /bin/zsh
    

    and then you need to restart Terminal for it to take effect. I think with the Z shell .profile may be ignored, and only .zshrc may be used.

    Quite likely there is no real change how the M1 Macs work compared to Intel Macs; you just created these files on your old Mac many years ago and have all forgotten about it.