Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: shadypalm88 on May 15, 2004, 11:36 PM

Title: [ANSWERED] SC/BW Game List - UTF-8?
Post by: shadypalm88 on May 15, 2004, 11:36 PM
I've been working on retrieving a list of SC/BW games to show on my bot.  For the most part it works, but when the list comes up, most names have some very strange characters in them, and when I log it with Ethereal, it doesn't even know what to make of the characters and just displays periods on the text side of the dump.

So I'm guessing that they're UTF-8 encoded.  I'm also guessing that I'd need to use WideCharToMultiByte to read them, but since I've heard say that the UTF-8 encoding that SC/BW uses is broken, will this work?  Also, the WideCharToMultiByte function asks how many characters there are in the string.  Is it safe to simply give it the Len() of the string?  Speaking of Len(), the bot is written in VB6, is there an easier way to do this?  And if I get this working for game names, should I be doing this for chat text too?
Title: Re:SC/BW Game List - UTF-8?
Post by: Stealth on May 16, 2004, 01:47 AM
Skywing wrote a pair of UTF-8 conversion routines in C++, and they were ported to VB (http://forum.valhallalegends.com/phpbbs/index.php?board=18;action=display;threadid=1027;start=msg9218#msg9218) by Camel.
Title: Re:SC/BW Game List - UTF-8?
Post by: shadypalm88 on May 16, 2004, 10:41 AM
Thanks.
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: MyndFyre on May 16, 2004, 01:26 PM
Something else to not do is to edit your subject to prepend something like [ANSWERED] or [RESOLVED].  We can tell whether or not the question has been answered, or at least discussed, by looking at how many repies there have been.  Thanks.  :)
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: warz on May 16, 2004, 01:50 PM
Quote from: Myndfyre on May 16, 2004, 01:26 PM
Something else to not do is to edit your subject to prepend something like [ANSWERED] or [RESOLVED].  We can tell whether or not the question has been answered, or at least discussed, by looking at how many repies there have been.  Thanks.  :)

Why not? If there's an [RESOLVED] before the topic, somebody would know to look in that thread instead of the other 10 threads pertaining to the same topic for a quick answer.
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: Soul Taker on May 16, 2004, 02:09 PM
Quote from: warz on May 16, 2004, 01:50 PM
Quote from: Myndfyre on May 16, 2004, 01:26 PM
Something else to not do is to edit your subject to prepend something like [ANSWERED] or [RESOLVED].  We can tell whether or not the question has been answered, or at least discussed, by looking at how many repies there have been.  Thanks.  :)

Why not? If there's an [RESOLVED] before the topic, somebody would know to look in that thread instead of the other 10 threads pertaining to the same topic for a quick answer.
Most threads go off-topic fast though, so it could get annoying if done en-masse, IMO.
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: shadypalm88 on May 16, 2004, 03:13 PM
Quote from: Soul Taker on May 16, 2004, 02:09 PM
Most threads go off-topic fast though...
Like this one?
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: Adron on May 16, 2004, 03:31 PM
Quote from: shadypalm88 on May 16, 2004, 03:13 PM
Quote from: Soul Taker on May 16, 2004, 02:09 PM
Most threads go off-topic fast though...
Like this one?

No, not really, typically they go much more off topic. This topic was still talking about the topic.
Title: Re:SC/BW Game List - UTF-8?
Post by: Skywing on May 17, 2004, 07:15 PM
Quote from: Stealth on May 16, 2004, 01:47 AM
Skywing wrote a pair of UTF-8 conversion routines in C++, and they were ported to VB (http://forum.valhallalegends.com/phpbbs/index.php?board=18;action=display;threadid=1027;start=msg9218#msg9218) by Camel.
Be warned that those routines will (correctly) refuse to process redundant encodings.  So you shouldn't expect to see the Starcraft color codes showing up if you use them...
Title: Re:SC/BW Game List - UTF-8?
Post by: shadypalm88 on May 17, 2004, 07:53 PM
Quote from: Skywing on May 17, 2004, 07:15 PM
Be warned that those routines will (correctly) refuse to process redundant encodings.  So you shouldn't expect to see the Starcraft color codes showing up if you use them...
Not sure if I completely understand "refuse to process".  If I run a message with a color code through it, will it just skip the codes, or will it not process the entire message?

And, is a redundant encoding just characters from one encoding inside a string using a different encoding, or what?
Title: Re:[ANSWERED] SC/BW Game List - UTF-8?
Post by: tA-Kane on May 18, 2004, 07:36 PM
Back off topic again, but personally, I rather like the idea of prepending [ANSWERED] to topics that have been resolved, as long as it doesn't totally replace the topic's name (eg renaming to [RESOLVED] instead of pre- or post-pending).