Hello, I tried to host a demo site using the MVC Edition, where i am using a shapefile containing a unicode text to use it as label for the features. the problem is that the text is not displaying correctly (characters are displaying in ascii )!! Can this problem be solved inside my project? or it is related to the hosting server ?
Unicode text is not displaying as labeling
Hello Joe,
Thanks for your post, for unicode problem, we have a property named Encoding can reslove this problem.
shapeLayer.Encoding = Encoding.GetEncoding(1256);//encoding no depends on your environment
Regards,
Gary
Thanks Gary,
I tried to put it to Unicode, but the label disappear,
My language is the Arabic.
I think the problem is inside the shapefile, because the same problem appears in a desktop edition project, or in a shapefile viewer unless i modify the following option in windows: Language for non-unicode languages = Arabic.
Is there anyway to modify the shapefile text content to make it as Unicode ??
Is there any solution similar to that:
support.esri.com/en/knowledgebase/techarticles/detail/21106
Thanks
Hi,
I tried to convert my shapefiles into a PersonalGeodatabase, the data are displaying correctly inside the .mdb file, and the GIS viewer (ArcExplorer for example), but in my project the labeling is displaying as "?????", What to do?
Thanks
Hi Joe,
I think the first step is to find out he exact encoding your shapefile is using for its DBF. In your first post you stated that the test is Unicode, but then stated that you tried to change it to Unicode?
You need to find out or set the encoding for your shapefile and then use Gary’s code (with your encoding value) to allow Map Suite to read it. For advice on how to modify the encoding for your files, Google is your best option as there are many methods available.
OK, I didn’t find anyway to convert my shapefiles content from one encoding to another>
And i am asking why the PersonalGeoDatabaseFeatureLayer doesn’t read the unicode text at all, even if i am setting the “non-unicode language” into my language (Arabic), is this a bug?
Thanks,
Joe
Hi Joe,
Let's setup what exactly where the problem is occuring by going back to your original shapefile example. There could be issues with the conversion process from shapefile to PersonalGeoDatabase so let's focus on the Encoding issue with the shapefile first.
Can you verify if the shapefile contains Unicode text or what encoding it uses?
Can you provide your Map Suite code that shows where you are setting the Encoding and loading the shapefile?
Hi,
After trying many solutions, i found the following one useful:
- I used a method to convert the encoding of the text inside the shapefiles from ANSI to UTF-8, then i set the encoding of the layer to UTF-8, all is done. the method is by using the QGIS open source project (qgis.org/) by opening the shapefile in (System encoding), then "save as" with UTF-8.
- To use a PersonalGeodatabase, i was not able to make the label clear, because: - no way to show the default data, - after converting shapefiles, then building from it a new PersonalGeodatabase, there is no way to specify the encoding of the layer (this feature exists only with ShapefileFeaturelayer).
So, my problem was solved with shapefiles, what about PersonalGeodatabase? because i need to make all my shapefiles inside one file (PGDB).
another question: how to set a password for the .mdb file, and then use this password when opening the featureclasses from the mapsuite library (there is no parameter for a password inside the API).
Thanks
Hi Joe,
I am glad you were able to convert your shapefile to an Encoding type that would work.
The PersonalGeoDatabaseFeatureLayer is implemented using the FDO extension which is a third-party library so I am not sure if this is a property that can be added to MapSuite. I will have to check in with another resource to verify if this is an option.
For your question about password protected PersonalGeodatabases you will need to create a new thread so that we can address that as a seperate issue.
Hi Joe,
As with your other post this functionality is dependent on what changes can be made to the FDO library which is a third-party library. This has been added as a future enhancement but I do not expect this to be added soon unless you would be intersted in setting up a Professional Services project.
Hi Joe,
After research on it, seems that the error comes from the FDO library when reading data using Unicode, we did many studies on it, but still are unable to give a fix or a workaround now. I’m not sure if we can overwrite their method.
Thanks,
James