Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 10 of 10
  1. #1
    Join Date
    December 2009
    Location
    Japan
    Posts
    27

    Solved [Fixed] onTextMessageEvent : can't handle multibyte string

    onTextMessageEvent can't handle correctly.

    If text message includes multibyte character, onTextMessageEventís 7th parameter "const char* message" corrupts.

    All multibyte character converted into "?".

  2. #2
    Join Date
    June 2002
    Location
    KrŁn / Germany
    Posts
    1,638
    all our strings come in utf8 format

  3. #3
    Join Date
    December 2009
    Location
    Japan
    Posts
    27
    Quote Originally Posted by R. Ludwig View Post
    all our strings come in utf8 format
    Your internal strings may come in utf8.
    But, the strings returning from onTextMessageEvent aren't utf8.
    I check the string in binary level including.

  4. #4
    Join Date
    June 2008
    Posts
    18,513
    UTF8 works in our client, please paste ous your string.

  5. #5
    Join Date
    December 2009
    Location
    Japan
    Posts
    27
    I typed the Japanese string "テスト" which means "test" in Japanese.

    I enabled Test Plugin.

    Here is the sample picture.

    http://hovel.arcenserv.info/uploda/src/file1.jpg

  6. #6
    Join Date
    August 2009
    Location
    Germany
    Posts
    53
    All our strings are definetly handled in UTF-8 and so are the strings passed through "onTextMessageEvent".
    If you view the chatlog and open it with e.g. Notepad++, all was written correct - even the "plain text" log.
    I think the console is not an appropriate way to display because it is very limited and can only use one font at a time.

  7. #7
    Join Date
    December 2009
    Location
    Japan
    Posts
    27
    You suggest viewing string is broken, but internal strings is correct?
    I mentioned internal strings is corrupted.

    e.g.
    To check the string in binary level, I add the following code into plugin.c in the test_plugin source code.

    Code:
    int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
    	printf("PLUGIN: onTextMessageEvent %llu %d %d %s %s %d\n", (long long unsigned int)serverConnectionHandlerID, targetMode, fromID, fromName, message, ffIgnored);
    	printf("message: ");
    	for(int i = 0; i< strlen(message); i++)
    	{
    		printf("%2X ", message[i]);
    	}
    	puts("");
    I typed the strings "テ", "テス", "テスト", and "test".
    Here is the result in the console.
    http://hovel.arcenserv.info/uploda/src/file3.jpg

    All Japanese characters was converted into 0x3F which means ? in UTF8.

    I previously mentioned , I checked the string in binary level.

    This issue was caused in other languages such as Russian, Korean.

    I'm sorry for my bad English.

  8. #8
    Join Date
    August 2009
    Location
    Germany
    Posts
    53
    Honestly, I don't know how to write "テスト" with my keyboard, so I just use copy & paste.

    Did nearly exactly the way you described above:

    ...
    int i;
    char msg[1024];
    printf("message: ");
    for(i = 0; i< strlen(message); i++) {
    printf("%2X ", message[i]);
    }
    puts("");
    snprintf(msg, sizeof(msg), "ts3plugin_onTextMessageEvent %s", message);
    ts3Functions.logMessage(msg, LogLevel_INFO, "Plugin", serverConnectionHandlerID);

    And this is my output:

    PLUGIN: onTextMessageEvent 1 2 1 Rico “‚Ś“ť╣“‚Í 0
    message: FFFFFFE3 FFFFFF83 FFFFFF86 FFFFFFE3 FFFFFF82 FFFFFFB9 FFFFFE3 FFFFFF83 FFFFFF88

    Besides I'm using Win7 and I still think the console on this OS is far better. The charset is called 'Consolas' and does not include any Japanese chars so it prints something else mapped ("“‚Ś“ť╣“‚Í") which on your side is just a '?' for every char.

    But if you view the clientlog now, you can spot your written chars inside. I still suppose we did everything correct

  9. #9
    Join Date
    December 2009
    Location
    Japan
    Posts
    27
    It may be machine depended ...

    This problem happened from TeamSpeak3 Client beta23.

    In client beta22, it didn't happened.

    I use Windows 7 Ultimate Edition 64bit in Japanese locale.

  10. #10
    Join Date
    December 2009
    Location
    Japan
    Posts
    27
    This issue has fixed in latest pre-rlease version.

    Thank you for your replying.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] Regular Expression / Wildcard / Fixed String- Explained - Please?
    By squirrelof09 in forum General Questions
    Replies: 3
    Last Post: May 11th, 2018, 08:36 PM
  2. [Not possible] Modify message in onTextMessageEvent
    By Kalvin in forum Client Plugins / Lua Scripts
    Replies: 5
    Last Post: June 18th, 2014, 08:09 AM
  3. Replies: 7
    Last Post: August 18th, 2011, 03:15 PM
  4. onTextMessageEvent: Repeating Chat changes "message"
    By blophy in forum Bug Reports [EN/DE]
    Replies: 0
    Last Post: June 23rd, 2010, 01:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •