Jump to content

MS 2 UTF8 - Mass Save To Unicode


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Spoiler

145924Cs5f4z4h.jpg
145924jEngTgFh.png
145924RS6ToaOh.png

 

I made this script because I got tired of all the binary warnings about saving the file to Unicode format. So I am now releasing it to the community.

This is a Windows PowerShell script that converts all the files of the destination that have the postfix *.cpp and *.h to UTF-8 (without BOM) encoding.

 

I made this script because I got tired of all the binary warnings about saving the file to Unicode format. So I am now releasing it to the community.

This is a Windows PowerShell script that converts all the files of the destination that have the postfix *.cpp and *.h to UTF-8 (without BOM) encoding.

By default, the file will look inside the directory "C:\Users\user\Documents\" but there is a -Dir parameter you can use (besides editing the file of course). Specify your working directory and wait a few seconds for the process to start. After that, there is really nothing else to do!

 

EXTRA: There is one more parameter you can specify here. A boolean check by the name -Src (disabled by default). If you pass "1" in here the script will automatically check for file extensions *.c and *.hpp (the source files of the Extern folder).

  • Metin2 Dev 16
  • Smile Tear 1
  • Think 1
  • Confused 1
  • Good 5
  • Love 2
  • Love 13
Link to comment
Share on other sites

  • 1 month later...

Thanks for the tool.
I ran into some errors using the locale_string.txt, because mine can not properly be converted into UTF-8.
This is because the korean texts are encoded in cp949 and my local translation has some special characters in ISO-8859-1.
Therefore I wrote a small tool converting the korean texts encoded as CP949 into UTF-8 and some european character set ISO-8859-1 into UTF-8.
Maybe it is useful for you and you can adjust the character sets for your needs.

NOTE: You need iconv by GNU to link this application :)

This is the hidden content, please

This is the hidden content, please

  • Metin2 Dev 13
  • Think 1
  • Good 6
  • Love 5
Link to comment
Share on other sites

2 minutes ago, DaCookie -Raven said:

Thanks for the tool.
I ran into some errors using the locale_string.txt, because mine can not properly be converted into UTF-8.
This is because the korean texts are encoded in cp949 and my local translation has some special characters in ISO-8859-1.
Therefore I wrote a small tool converting the korean texts encoded as CP949 into UTF-8 and some european character set ISO-8859-1 into UTF-8.
Maybe it is useful for you and you can adjust the character sets for your needs.

NOTE: You need iconv by GNU to link this application :)

iconvpp.h

main.cpp

Sorry to break it to you but this tool is meant to be used in the Client source only. Because of the locale messages, server source should never be converted to UTF-8 unless it's original encoding was Unicode. If you need a UTF-8 source:

  1. Use Vanilla
  2. Make an exact copy of your source and convert it using the tool. Then start copying the Korean strings from the non-Unicode to Unicode encoded source, one by one.

Best regards

Link to comment
Share on other sites

1 hour ago, Mind Rapist said:

Sorry to break it to you but this tool is meant to be used in the Client source only. Because of the locale messages, server source should never be converted to UTF-8 unless it's original encoding was Unicode. If you need a UTF-8 source:

  1. Use Vanilla
  2. Make an exact copy of your source and convert it using the tool. Then start copying the Korean strings from the non-Unicode to Unicode encoded source, one by one.

Best regards

Well I used my IDEs option to convert all server source files to UTF-8.
That's why I ran into problems with locale_string.txt
Because I`m lazy and don't want to copy the korean strings one by one I wrote this tool.
Also it is a nice thing to work with a standard encoding :)

Link to comment
Share on other sites

Announcements



  • Similar Content

  • Activity

    1. 24

      Experimental Renderer

    2. 11

      Multi Language System

    3. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    4. 4

      Feeding game source to LLM

    5. 0

      Quest 6/7 Problem

    6. 5

      Effect weapons

    7. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    8. 3

      Crystal Metinstone

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.