"WIN10" transplant OPENCC to WIN10-UWP, and make your own simple conversion tool

Source: Internet
Author: User

It took the weekend two days to transplant the OPENCC into a WIN10-UWP usable library and complete its own conversion tool.

My simple tool download address: https://www.microsoft.com/store/apps/9nblggh68g62

Post-transplant code download address: Http://yunpan.cn/cFiYYCxwTLdfX access password 0533

Because today (2015-11-1-20:18), so if you are in today or the next Sando, is not found this software, because the micro-software store in the review.

A GIF to look at:

Taiwan's "Software " can be transformed into a continental " soft " Oh.

1. Porting1) Create a Vc++,dll Universal project

2) for (auto x:xs) to replace all for each (auto X in xs)

3) To close the security check, this is to make strcpy and other functions translated through.

4) All OPENCC CPP files, to disable the presets.

5) in the Config.cpp, to put #include <unordered_map> on the top, or not to edit. Unknown origin for the reason of the body.

After these steps, a DLL has been created successfully.

2. Create Runtinecomponent

I don't know if the C # project can directly adjust the DLL, without trying. Even if it can be adjusted, it is also a matter of trouble, and need to deal with a lot of types of conversion problems.

So, we need to create a generic project, all languages can be used to adjust the module, this module is runtinecomponent.

Can participate in the test blog: http://www.cnblogs.com/webabcd/p/3422563.html

And some of C++/cx's references, which you need to know: https://msdn.microsoft.com/en-us/library/windows/apps/hh699871.aspx

My example, named OPENCCX, adds an X to the back, which means that this is a mess, not the original author.

3. Using Runtinecomponent

Create a C # UWP project and add Openccxruntinecomponent Engineering to your solution.

In the UWP project, add a reference, select the project, and click "Make sure".

Then, you can use the Openccxruntinecomponent name space in your project.

The example is very simple:

New OPENCCXRUNTINECOMPONENT.OPENCCX ();---Create opencc_s2t. Load (OpenCCxRuntineComponent.ConverterType.Simple2Traditional);  ---use what conversion rules
        Private void Btn2simple_click (object  sender, RoutedEventArgs e)        {            string ret = Opencc_t2s. Convert (TextBox.Text); ---use simple convert to OK.             if NULL             {                = ret;            }        }

You can use a OPENCCX variable to load which.

In my code, the loaded stuff is saved and will not be re-downloaded.

You can also use more than one OPENCCX variable, and a change represents a conversion to see what a person needs.

[PS]

Finally, you can use your own simple conversion tool ^_^, thanks to OPENCC author.

OPENCC Address: Https://github.com/BYVoid/OpenCC

In line OPENCC address: opencc.byvoid.com

[END]

"WIN10" transplant OPENCC to WIN10-UWP, and make your own simple conversion tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.