Casual dress codes are set less by law than by climate, religion, and urban culture, and misjudging them costs comfort rather than trouble in most places. The global picture: in western Europe, the Americas, East Asia, and Australia, shorts, sleeveless tops, and sandals are unremarkable street wear, though some cities skew noticeably more put-together, and athletic wear as daily clothing marks you as a visitor in the dressier capitals. In South Asia, the Middle East, and much of Southeast Asia and Africa, everyday modesty runs higher: locals of both genders commonly cover shoulders and knees in daily life, and visitors who match this draw less attention, negotiate better, and feel more welcome, with women's calculus being noticeably affected by dress in conservative regions.
Cities are more relaxed than countryside almost everywhere, beach towns more relaxed than inland ones, and religiously conservative countries can have legal or strongly enforced modesty expectations that visitors should know before packing.
The packing formula that has never failed me: lightweight trousers or long skirts, a few tops covering shoulders, one scarf or shawl for spontaneous temple visits and cold buses, and sandals plus one closed pair. Then watch what locals your age wear in the first day and adjust. Dressing one notch more modestly than home almost always lands right.