Jump to content

cinntique

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by cinntique

  1. 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?

×
×
  • Create New...