for some things bash will be unhappy with UTF-8 standard encoding.
UTF-8 is pretty much like ASCII up to char #127 - it's one byte.
The original vertsions of bash like old-fashioned ASCII, I don't know about newer versions.
However carriage control under unix means ASCII 10 "^J" is newline -- \n.
Under UTF-8, based on unicode, you can have two characters for newline
ASCII 10 "^J" and ascii 13 "^M".
Use od on your bash scripts to look for these spuriouscarriage control chars. They will also show up in vi.
UltraEdit and some other Windows PC editors will convert lower UTF-8 to so-called unix as well.
Short answer - learn to use vi or emacs for shell scripts.