[mapguide-users] extended characters with .NET

Aldata darren.karasiuk at aldatasoftware.com
Wed Mar 11 18:49:41 EDT 2009


Hi everyone,
I have a problem with using extended characters with fonts.

When I create a layer with Autodesk Map Guide Studio and use a Wingdings
arrow as the point style, there is no problem.
I load the exported xml layer.definition in my .NET application, change the
filter, save the resource, and add the layer to the the map.  At this point,
the data loads and plots successfully, but the point style that is expected
to be an arrow, is now a picture of hand holding a pen, the equivalent of a
the question mark (?) in a normal text font.

I figure it's .NET converting the UTF-8 character into ASCII or UNICODE that
is trouble.  The Webdings font works fine up until character decimal 127.
After that, the hand holding a pen again.

I tried to use the notation & #xE9; (space added so webpage doesn't
interpret) but again, no go. I also tried the decimal version with no
success.

How can I load, edit, and output layer.definition containing extended
characters using .NET?

What I have:
        Dim layerXMLDoc As XmlDocument = New XmlDocument()
        Dim XMLDocPath As String =
Server.MapPath("layerdef\trucks.LayerDefinition.xml")
        Dim sr As New IO.StreamReader(XMLDocPath, System.Text.Encoding.UTF8)
        layerXMLDoc.LoadXml(sr.ReadToEnd())
        sr.Close()
...
Dim newLayer As MgLayer = add_layer_definition_to_map(layerXMLDoc.OuterXml,
"layer-eq" + EquipmentList.SelectedValue.ToString,
EquipmentList.SelectedItem.ToString)
....
-----

This function was more or less copied from the api documents which receives
the layerXMLDoc as the first parameter.  Is the problem with out it's
passed?

 Public Function add_layer_definition_to_map(ByVal layerDefinition As
String, ByVal layerName As String, ByVal layerLegendLabel As String) As
MgLayer
        'Validate the XML
        Dim XmlDoc As New XmlDocument
        XmlDoc.LoadXml(layerDefinition)
        'don't understand validation yet

        Dim encoding As New System.Text.ASCIIEncoding() ' Is the problem
here???

        Dim byteSource As New
MgByteSource(encoding.GetBytes(layerDefinition.ToString),
layerDefinition.Length)
        byteSource.SetMimeType(MgMimeType.Xml)
....
-------

Thanks for your time!
-- 
View this message in context: http://n2.nabble.com/extended-characters-with-.NET-tp2464283p2464283.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list