• Welcome to Valhalla Legends Archive.
 

[ANSWERED] SC/BW Game List - UTF-8?

Started by shadypalm88, May 15, 2004, 11:36 PM

Previous topic - Next topic

shadypalm88

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?

Stealth

Skywing wrote a pair of UTF-8 conversion routines in C++, and they were ported to VB by Camel.
- Stealth
Author of StealthBot

shadypalm88


MyndFyre

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.  :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

warz

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.

Soul Taker

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.

shadypalm88


Adron

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.

Skywing

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

shadypalm88

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?

tA-Kane

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).
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com