I have downloaded the SHP file from the openstreetmap, and try to read the data from the shp. But when I get the attribute "name", I have no idea to decode them to Chinese. Refer to the OpenstreetMap documents, it shows that all the strings are encoded by UTF-8, but the followding code didnt' work (return the messy chars). new String(feature.getAttribute("name").toString().getBytes("UTF-8"), "gbk"). asked 07 Jun '21, 10:13 paradise099 |
Hi, I had faced a similar situation to yours. I tried to re-download the file and defined the encoding to UTF-8 in QGIS. Maybe this article will help you https://communities.bentley.com/products/hydraulics_hydrology/w/hydraulics_and_hydrologywiki/37273/characters-in-a-shapefile-do-not-appear-correctly-in-the-modelbuilder-preview (or visit communities.bentley.com and find a page 'Characters in a shapefile do not appear correctly in the ModelBuilder preview') answered 10 Jun '21, 07:56 zramadhanis |
Can you explain in a bit more detail what your end goal is?
Where are you getting a SHP file?
Download the SHP from the website: https://download.geofabrik.de
I want to compare the speed of the real road data.