|
Re: TextEncodings. :P: msg#03023lang.realbasic.user
How do I input chr(240) and get out (unicode) &hF8FF? Well, the first question is, what is chr(240)? By looking at a table of MacRoman characters and comparing to a unicode table, I see the character you're interested in appears to be an Apple logo. But the computer cannot know what you mean by chr(240) unless you tell it. 240 is a different character in different encodings. It's an Apple symbol in MacRoman, but it's something else in WindowsLatin1, and something else again in Shift-JIS (a Japanese encoding). So, what you want to do is tell the computer that you want character 240 *in MacRoman*. You can do this with the following code: s = Encodings.MacRoman.Chr(240) Now you've got the right character in the string, so any further conversions are easy. For example, if you want to convert the string from MacRoman to Unicode, you'd use the ConvertEncoding function. Note, though, that saying you want "Unicode" is a little vague. There are several varieties of Unicode. The most common variations are UTF-8 and UTF-16. You'd convert s to one of these like this: s = s.ConvertEncoding(Encodings.UTF8) or s = s.ConvertEncoding(Encodings.UTF16) v---- I wish this stuff didn't get added :P ----v You could always quit using Hotmail if you don't like that stuff. I assume you're using the hotmail address for spam protection, so you can ditch the account when it gets spammy, correct? If so, just get your own domain name. I can ditch this address any time and create a new, fresh one. And it's quite cheap! (I pay only $9.95 per month for all of the BitJuggler hosting services, and the company I use offers an even cheaper service that would only cost about $5 per month.) -- -Thomas Personal web page: http://homepage.mac.com/thomasareed/ My shareware: http://www.bitjuggler.com/ REALbasic page: http://www.bitjuggler.com/extra/ There are 10 kinds of people in the world -- those who understand binary numbers and those who don't. - - - Unsubscribe or switch delivery mode: <http://support.realsoftware.com/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Adding a directory to a folderitem?, Thomas Reed |
|---|---|
| Next by Date: | Re: [OFF] Most efficient method of person to person payment, Chris Smolinski |
| Previous by Thread: | Re: TextEncodings. :P, Joseph J. Strout |
| Next by Thread: | Re: [now OT]TextEncodings. :P, jungk-GlBktcauxgOZhaM+4OpCHwC/G2K4zDHf |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |