Jump to content

Database Encoding Problem (ISO-8859-1 to EUC-KR)


cinntique

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  12/10/18
  • Last Seen:  

I found a problem with this function

(src/common/strlib.cpp : normalize_name)

 

I am a Korean. So I wanted to create a character name in Korean.

after a long trial, I realized that Ragnarok client encode strings with ISO-8859-1.

So, in inter_conf.txt, I set the default_codepage to euc-kr.

But, I couldn't create a character name with '강' and '서'.

These words have been converted to '?'.

char* normalize_name(char* str,const char* delims)
{
    char* in = str;
    char* out = str;
    int put_space = 0;

    if( str == NULL || delims == NULL )
        return str;

    // trim start of string
    while( *in && strchr(delims,*in) )
        ++in;
    while( *in )
    {
        if( put_space )
        {// replace trim characters with a single space
            *out = ' ';
            ++out;
        }
        // copy non trim characters
        while( *in && !strchr(delims,*in) )
        {
            *out = *in;
            ++out;
            ++in;
        }
        // skip trim characters
        while( *in && strchr(delims,*in) )
            ++in;
        put_space = 1;
    }
    *out = '\0';
    return str;
}

I checked that it worked as normal when the above function was removed.

But I'm not an expert on C++ so I don't know how to fix it.

 

Can someone help me?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

1. Your clientinfo.xml config should have next:
 

<servicetype>korea</servicetype>
<langtype>0</langtype>

2. Now, you need to configure MySQL server (or MariaDB, or whatever you have) 

Options what is interesting for you is next:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci

3. Now, create a new database after applying these settings.

Will be created a database, with correct encoding (as far as I remember utf8mb4 support Korean characters pretty well).

4. Now, import your SQL files there, like you always do. (main.sql, logs.sql, etc)

5. Now, open your inter_athena.conf and find next option and make them hardcoded info what charset to use:

// You can specify the codepage to use in your MySQL tables here.
// (Note that this feature requires MySQL 4.1+)
default_codepage: utf8mb4

At this point everything will be okay, but depends on a lot of differences between a lot of charsets default in different regional operation system with national languages, charsets of the windows can be different, 1252, 1251, etc.

6. You can manually force a client to use utf8

For that, you need to download dininput.dll & ini file: DOWNLOAD DININPUT or ALTERNATIVE LINK  if the previous one will die.

7. And now run your client and play. Everything should be good.

Edited by Anacondaqq
Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   2
  • Joined:  02/15/13
  • Last Seen:  

default_codepage: utf8mb4
mysql => utf8mb4_unicode_ci
clinent => dininput.dll & ini

Three of the four characters look like this: ???

1.png

Edited by casper
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   2
  • Joined:  02/15/13
  • Last Seen:  

On 12/15/2018 at 2:46 AM, anacondaq said:

help me...

1. Your clientinfo.xml config should have next:
 

<servicetype>korea</servicetype>
<langtype>0</langtype>

2. Now, you need to configure MySQL server (or MariaDB, or whatever you have) 

Options what is interesting for you is next:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci

3. Now, create a new database after applying these settings.

Will be created a database, with correct encoding (as far as I remember utf8mb4 support Korean characters pretty well).

4. Now, import your SQL files there, like you always do. (main.sql, logs.sql, etc)

5. Now, open your inter_athena.conf and find next option and make them hardcoded info what charset to use:

// You can specify the codepage to use in your MySQL tables here.
// (Note that this feature requires MySQL 4.1+)
default_codepage: utf8mb4

At this point everything will be okay, but depends on a lot of differences between a lot of charsets default in different regional operation system with national languages, charsets of the windows can be different, 1252, 1251, etc.

6. You can manually force a client to use utf8

For that, you need to download dininput.dll & ini file: DOWNLOAD DININPUT or ALTERNATIVE LINK  if the previous one will die.

7. And now run your client and play. Everything should be good.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...