Closed jsmariegaard closed 3 years ago
utf-8 is not optimal - as it will give "Hornb�k" instead of "Hornbæk" in the below test...
decode("iso-8859-1") would fix the problem in this case but is of course not a general solution
Question if UTF-8 is the right encoding to use, but I would not know of any better. The MIKE Zero Tools etc. are based on the Microsoft MBCS (MultiByte Character Set) encoding, but I guess that is not supported from within Python. MBCS and UTF-8 agrees on more characters than just ascii, hence also the danish æøå.
I now replaced all uses of utf-8 with cp1252. Hope this is the right thing to do. At least the new tests are passing :-)
I now replaced all uses of utf-8 with cp1252. Hope this is the right thing to do. At least the new tests are passing :-)
So not possible to have 🌊 for metocean or 💩 for bathing water in the item names 😄 ?
Up to now, conversions between python strings and c char arrays was done assuming ascii. This gives an error if æøå or other none ascii characters are used.