Broken characters in Mission Planner plugin function after update

Hello,

I am having an issue with the Mission Planner plugin function. Previously, I was able to display several assigned takeoff locations on the flight planner map screen in Korean, as shown in the first image below:

However, after an mission planner update today, the characters are now broken, as shown in the second image below:

화면 캡처 2023-03-26 111107

I believe the previous version I used was 1.3.79, but I am not entirely sure. Regardless, the previous version was a recent version as well.

I suspect that something may have changed in the language preferences on Google Maps API during the update. My plugin code is as follows:

var location7 = new GMap.NET.PointLatLng(xx.xxxxx, xx.xxxxxx);
var marker7 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location7, 
GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
marker7.ToolTipText = "이륙지 이름";
marker7.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
marker7.ToolTip.Offset = new Point(-50, 10); 
marker7.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
marker7.Size = new System.Drawing.Size(25, 25);
takingOffPositionOverlay.Markers.Add(marker7);

In addition to the first issue, I have encountered another problem. After changing my settings to Korean, the “language setting” option disappeared, and I am unable to switch back to English. I have attempted to select English options to resolve the previous issue, but to no avail. Please refer to the screenshot below:


In the screenshot provided, the red circled option, which reads “인터페이스 언어” in Korean, translates to “interface languages” in English. However, there are currently no language options available in the menu. Instead, only “Warning” and “Notice” options are present.

Thank you for your assistance in resolving these issues.

I have successfully changed the language option in Mission Planner by replacing “ko-KR” with “en” in the “config.xml” file. However, I am concerned that this change may have unintended consequences or cause bugs in the program since I am not fully familiar with its structure.

Unfortunately, the issue of the plugin’s marker displaying broken characters with Korean language remains unresolved.

Hi,
I tried with the master branch from github, and it seems to working.
image
Try to up your Mission Planner code to the latest master, and also recompile your plugin. There were some package version changes recently in the code.

The Language selection issue is indeed an error, I’ll send in a fix for it. Meanwhile it is OK, if you change the language in the config.xml.

Thank you for your help.

Previously, I tried to extract a branch of the mission planner, but encountered an error related to the .NET framework. Although I installed some .NET packages, the issue remained unresolved.

As a result, I am currently only working with a plugin using Visual Studio.

Nevertheless, I appreciate your confirmation that the problem is not related to the mission planner itself.

I will keep working on resolving this issue. Once again, thank you for your assistance.

I uninstalled Mission Planner and reinstalled it using this link: Installing Mission Planner — Mission Planner documentation. However, it did not work. I will investigate the problem further. This information is provided for your reference.

I’m suspecting it is problem related to PluginLoader(Code Generator), but I’m not sure. it should interpret code using utf-8

For the sake of certainty, I manually deleted the Mission Planner folder after using the uninstaller. Then, I restarted my laptop and reinstalled Mission Planner from the official doc. However, the Korean characters are still broken. In the previous version of Mission Planner, they were displayed correctly.

Because my original code won’t work without AIS(ship) receiver connected to laptop LAN port and AISParser.dll, and too complex,
for you, I will post up the simple code that regenerate error :

using System;
using System.Windows.Forms; 
using GMap.NET.WindowsForms.Markers;
using GMap.NET;
using GMap.NET.WindowsForms;
using System.Drawing;

namespace MDTPlugins
{
    public class MDTPlugins : MissionPlanner.Plugin.Plugin
    {
        private GMapOverlay shipOverlayFP; 
        private GMapOverlay takingOffPositionOverlay; 
        
        public override string Name
        {
            get { return "Regenerate Error"; }
        }

        public override string Version
        {
            get { return "0.30"; }
        }

        public override string Author
        {
            get { return "Truth"; }
        }

        public override bool Init()
        {
            return true;
        }

        public override bool Loaded() 
        {
            takingOffPositionOverlay = new GMapOverlay();
            takingOffPositionOverlay.IsVisibile = true;
            Host.FPGMapControl.Overlays.Add(takingOffPositionOverlay); 

            MarkingTakingOffPositionMarker();

            loopratehz = 12.0f;

            return true;
        }

        public override bool Loop()
        {
            loopratehz = 20.0f;
            return true;
        }


        public override bool Exit() 
        {
            return true;
        }


        private void MarkingTakingOffPositionMarker()
        {
            var location1 = new GMap.NET.PointLatLng(35.0724, 129.05471);
            var marker1 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location1, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker1.ToolTipText = "location 1";
            marker1.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker1.ToolTip.Offset = new Point(-50, 10); 
            marker1.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker1.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker1);

            var location2 = new GMap.NET.PointLatLng(35.06711, 129.06562);
            var marker2 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location2, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker2.ToolTipText = "location 2";
            marker2.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker2.ToolTip.Offset = new Point(-30, 10); 
            marker2.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker2.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker2);

            var location4 = new GMap.NET.PointLatLng(35.06151, 129.07614);
            var marker4 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location4, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker4.ToolTipText = "감지해변";
            marker4.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker4.ToolTip.Offset = new Point(-30, 10); 
            marker4.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker4.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker4);

            var location5 = new GMap.NET.PointLatLng(35.04995, 129.08549);
            var marker5 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location5, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker5.ToolTipText = "location 5";
            marker5.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker5.ToolTip.Offset = new Point(-20, 10); 
            marker5.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker5.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker5);

            var location6 = new GMap.NET.PointLatLng(35.07416, 129.08309);
            var marker6 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location6, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker6.ToolTipText = "location 6";
            marker6.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker6.ToolTip.Offset = new Point(-50, 10); 
            marker6.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker6.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker6);

            var location7 = new GMap.NET.PointLatLng(35.07823, 129.08888);
            var marker7 = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(location7, GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue);
            marker7.ToolTipText = "location 7";
            marker7.ToolTipMode = GMap.NET.WindowsForms.MarkerTooltipMode.Always;
            marker7.ToolTip.Offset = new Point(-50, 10);
            marker7.ToolTip.Font = new Font("Arial", 7, FontStyle.Bold);
            marker7.Size = new System.Drawing.Size(25, 25);
            takingOffPositionOverlay.Markers.Add(marker7);
        }

    }//end of Class Plugins
}// end of Namespace Plugins

this code will update overlay on flight planner.


edited : I removed location name and coordinate for privacy reason

Because this plugin may be used on expensive or offline GCS in the future, I want to make sure it works on the stock Mission Planner instead of a self-built mission planner.

I have found another issue that may provide clues to the solution.

when I run a basic plugin code that prints Korean text to the console, I see “??? ???” characters, as shown in the attached photo.

Based on this, I suspect that there may be an encoding problem with the plugin loader after the update. It seems that the plugin loader is handling the code differently after update, which is preventing Korean characters from being displayed properly.

below is my code :

using System;

namespace MDTPlugins
{
    public class MDTPlugins : MissionPlanner.Plugin.Plugin
    {     
        public override string Name
        {
            get { return "Regenerate Error 2"; }
        }

        public override string Version
        {
            get { return "0.30"; }
        }

        public override string Author
        {
            get { return "Truth"; }
        }

        public override bool Init()
        {
            return true;
        }

        public override bool Loaded() 
        {
            Console.WriteLine("플러그인 로드");
            loopratehz = 12.0f;

            return true;
        }

        public override bool Loop()
        {
            Console.WriteLine("플러그인 루프");
            loopratehz = 20.0f;
            return true;
        }

        public override bool Exit() 
        {
            return true;
        }
    }
}

I tried versions 1.3.79, 1.3.77, and 1.3.76, but none of them were able to display Korean characters. It’s a very mysterious issue.

anyway, After clicking the ‘OK’ button on the update message window, the Korean characters started to appear broken.

I discovered that mission planner 1.3.74 display korean character very well.

1.3.75 and above versions does not display korean characters well.

1.3.74 version display korean characters well.

for your console plugin add

Console.OutputEncoding = Encoding.UTF8;

seems utf8 is not the default

your marker plugin works fine for me though

After changing my code to use UTF-8 encoding, shape of the output character has been changed, but the character is still broken.

after change unicode

below is changed code :

using System;
using System.Text;

namespace MDTPlugins
{
    public class MDTPlugins : MissionPlanner.Plugin.Plugin
    {     
        public override string Name
        {
            get { return "Regenerate Error 2"; }
        }

        public override string Version
        {
            get { return "0.30"; }
        }

        public override string Author
        {
            get { return "Truth"; }
        }

        public override bool Init()
        {
            return true;
        }

        public override bool Loaded() 
        {
            Console.OutputEncoding = Encoding.UTF8;
            Console.WriteLine("플러그인 로드");
            loopratehz = 12.0f;

            return true;
        }

        public override bool Loop()
        {
            Console.WriteLine("플러그인 루프");
            //Console.WriteLine("\u216B");
            loopratehz = 20.0f;
            return true;
        }

        public override bool Exit() 
        {
            return true;
        }
    }
}

I suspect that the stock mission planner may be the source of the problem, and that developers who use self-built mission planners do not experience this issues. Regardless, I believe it would be a significant burden to ask the developer to modify this continually.

For now, I will display the information in English. Thank you. However, I do hope that a modification will be made in the future.

Additionally, I would like to draw your attention to another issue that I believe is more important. : "No SRTM data for this area" on south pacific sea

Still, mission planner version above 1.3.74 won’t display korean character.

1.3.74 version will display well.

I believe I solved this problem, but I don’t get a clue why this happens.

I believe this problem is related to file’s setting itself.

let’s suppose that C# file A displays korean well and C# file B displays korean bad.

If I copy C# file A and write the same code above, the korean displays well.

but if I copy C# file B and write the same code above, the korean is not displayed well!

I looked through the file’s properties, but couldn’t find a clue.

I’m using windows 11

Good.zip (452 Bytes)
Bad.zip (497 Bytes)

Good.zip contains the code that displays korean well.
Bad.Zip contains the code that displays korean bad.

to me, Good.zip and Bad.zip exactly same code. it looks same to me.

Sorry, the Good.zip omit the line

“Console.OutputEncoding = Encoding.UTF8;”

but, its not important. even though I add this line to good.zip code, it works well.

I believe updating mission planner effects plugins folder’s file’s encoding type or something, and that made this error happens.

for your reference, I’m using visual studio 2017 for editing .cs file.

I don’t know why, but one file’s encoding is EUC-KR and one file’s encoding is UTF-8 BOM.

I could check the encoding type with notepad++

I don’t know why the encoding changed suddenly.

is reinstalling mission planner able to affect this encoding types?

anyway, the problem is solved now.