473,526 Members | 2,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strings from hell

Hello, I'm hoping someone can point me in the right direction, or better
still, help me with a code snippet :)

I have the following text in a string:

"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?="

I want to convert it to displayable characters, like this:

"Ra?ving L???ie"

I know I will lose non-displayable characters, and that's exactly what I
want to do with the input text but I don't know how to do it. Can anyone
give me some advice on how to go about achieving that goal, please? I'd be
very grateful as I'm a novice and this has had me stumped for two days.

I have both .NET 2003 and .NET 2005, but prefer to work in 2005, if that
helps.
Nov 23 '05 #1
21 1042

So you basically want to only display certain ASCII values, so can't you
use chr.

Put the string in a loop and do

foreach(char c in s)
....print values that are <> n and n1

Harold Skeggs wrote:
Hello, I'm hoping someone can point me in the right direction, or better
still, help me with a code snippet :)

I have the following text in a string:

"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?="

I want to convert it to displayable characters, like this:

"Ra?ving L???ie"

I know I will lose non-displayable characters, and that's exactly what I
want to do with the input text but I don't know how to do it. Can anyone
give me some advice on how to go about achieving that goal, please? I'd be
very grateful as I'm a novice and this has had me stumped for two days.

I have both .NET 2003 and .NET 2005, but prefer to work in 2005, if that
helps.

Nov 23 '05 #2
"John A. Bailo" <ja*****@texeme.com> wrote in message
news:c4********************@speakeasy.net
So you basically want to only display certain ASCII values, so can't
you use chr.

Put the string in a loop and do

foreach(char c in s)
....print values that are <> n and n1
Huh?

How do you propose that your code will translate the string
"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?=" into the correct "Ra?ving
L???ie"?

Are you a linux-using idiot or something? Sheesh.
Harold Skeggs wrote:
Hello, I'm hoping someone can point me in the right direction, or
better still, help me with a code snippet :)

I have the following text in a string:

"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?="

I want to convert it to displayable characters, like this:

"Ra?ving L???ie"

I know I will lose non-displayable characters, and that's exactly
what I want to do with the input text but I don't know how to do it.
Can anyone give me some advice on how to go about achieving that
goal, please? I'd be very grateful as I'm a novice and this has had
me stumped for two days. I have both .NET 2003 and .NET 2005, but prefer
to work in 2005, if
that helps.

Nov 23 '05 #3
I can't make any sense out of your question either,
but it would help if you didn't post to both VB
and VB.Net. The groups with "dotnet" are for
..Net. The first group in your posting list is VB6
and under.

--
ma**********@mindXXspring.com
(Remove Xs for return email.)
Harold Skeggs <no.spam.for.me@thanks> wrote in message
news:dl**********@pita.alt.net...
"John A. Bailo" <ja*****@texeme.com> wrote in message
news:c4********************@speakeasy.net
So you basically want to only display certain ASCII values, so can't
you use chr.

Put the string in a loop and do

foreach(char c in s)
....print values that are <> n and n1
Huh?

How do you propose that your code will translate the string
"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?=" into the correct

"Ra?ving L???ie"?

Are you a linux-using idiot or something? Sheesh.
Harold Skeggs wrote:
Hello, I'm hoping someone can point me in the right direction, or
better still, help me with a code snippet :)

I have the following text in a string:

"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?="

I want to convert it to displayable characters, like this:

"Ra?ving L???ie"

I know I will lose non-displayable characters, and that's exactly
what I want to do with the input text but I don't know how to do it.
Can anyone give me some advice on how to go about achieving that
goal, please? I'd be very grateful as I'm a novice and this has had
me stumped for two days. I have both .NET 2003 and .NET 2005, but prefer to work in 2005, if
that helps.


Nov 23 '05 #4
"mayayana" <ma**********@mindXXspring.com> wrote in message
news:uw****************@newsread3.news.atl.earthli nk.net
I can't make any sense out of your question either,
Oh, so you're stupid too.
but it would help if you didn't post to both VB
and VB.Net. The groups with "dotnet" are for
.Net. The first group in your posting list is VB6
and under.

Nov 23 '05 #5
So you want to convert a UTF-8 encoded UNICODE string that is being
displayed as ASCII on screen into what it should show up as UNICODE on
screen? because thats sure as heck what i get out of what you wrote and the
whole "UTF-8" marker in it screams this is a UNICODE string broken into
ASCII... but you REALLY need to provide more information on what you want to
do.. showing a string and say turn it into this doesnt help many people
because that is way too vague. what is the formatting of the two strings...
i assume the intial one is UTF-8 based on its encoding marker... what is the
final format? basic UNICODE? if so look at the encode class in .NET

http://msdn.microsoft.com/library/en...dingTopic2.asp

Nov 23 '05 #6
and if that doesnt help you to figure out it on your own... convert the text
into a byte array... and use the encode.convert to convert it from one
format to another...

"Harold Skeggs" <no.spam.for.me@thanks> wrote in message
news:dl**********@pita.alt.net...
"mayayana" <ma**********@mindXXspring.com> wrote in message
news:uw****************@newsread3.news.atl.earthli nk.net
I can't make any sense out of your question either,


Oh, so you're stupid too.
but it would help if you didn't post to both VB
and VB.Net. The groups with "dotnet" are for
.Net. The first group in your posting list is VB6
and under.


Nov 23 '05 #7
Harold ,

Please reply in a normall way to the people who respond to your questions

I for a fact would never reply with a answer , when the reaction that did
not solve your problem to another person is like that

And yes to answer your question in forehand ,,,, Yes i am stupid to ,,,even
though I do stupid stuff, this people who are supposed to have average
intelligence do really stupid stuff, and a lot of it. They also are unaware
of so many solutions to their problems. This, of course, makes me feel
smart. But am I? Or am I just surrounded by idiots?
regards

Michel Posseth [MCP]

"Brian Henry" <no****@nospam.com> wrote in message
news:eK**************@TK2MSFTNGP12.phx.gbl...
and if that doesnt help you to figure out it on your own... convert the
text into a byte array... and use the encode.convert to convert it from
one format to another...

"Harold Skeggs" <no.spam.for.me@thanks> wrote in message
news:dl**********@pita.alt.net...
"mayayana" <ma**********@mindXXspring.com> wrote in message
news:uw****************@newsread3.news.atl.earthli nk.net
I can't make any sense out of your question either,


Oh, so you're stupid too.
but it would help if you didn't post to both VB
and VB.Net. The groups with "dotnet" are for
.Net. The first group in your posting list is VB6
and under.



Nov 23 '05 #8

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Harold ,

Please reply in a normall way to the people who respond to your questions

I for a fact would never reply with a answer


My feelings exactly. Rudeness on newsgroups never pays, stupid or
unintelligible replies or not.

Scott
Nov 23 '05 #9
Harold Skeggs wrote:
I can't make any sense out of your question either,


Oh, so you're stupid too.


That's the way to do it, Harold. Insult the people that try to help you.
You're way more likely to get assistance in the future after doing that.

--

(O)enone
Nov 23 '05 #10
"Bruno Jouhier" <bj******@club-internet.fr> wrote in message
news:43***********************@news.club-internet.fr...
The following program will decode it (somehow):

static void Main(string[] args)
{
string encoded = "=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?=";
// eliminate leading =?utf-8?B? and trailing ?=
encoded = encoded.Substring(10, encoded.Length - 12);
// decode base 64
byte[] bytes = Convert.FromBase64String(encoded);
// convert to string
string decoded = System.Text.Encoding.UTF8.GetString(bytes);
// print
Console.WriteLine(decoded);
}

But I get a slightly different result. I get something like
Ra?iXg L???iY
where X looks like a superscript n and Y looks like greek epsilon.

I don't know how you will be able to make sense out of the result.
I most certainly can. That is excellent work. Thank you very much. You are
worth your weight in gold. What I was missing was this...
// eliminate leading =?utf-8?B? and trailing ?=


It was a pleasure to get assistance from someone who knows what they're
doing instead of those who only pretend to know. Now I'm off to conquer the
world. Have a nice weekend, sir.

Regards,
Harold.
Nov 23 '05 #11
"J French" <er*****@nowhere.uk> wrote in message
news:43**************@news.btopenworld.com...
On Fri, 11 Nov 2005 11:57:19 +1100, "Harold Skeggs" One other point, if you persist in posting in this NG, then we shall
start cross posting to dotnet NGs - which will make a real mess


With me being a right cunt that can ruin your entire day with one
well-placed, incisive remark, I'm up for it.
Nov 23 '05 #12
"Harold Skeggs" <no.spam.for.me@thanks> wrote in message
news:dl**********@pita.alt.net
"Bruno Jouhier" <bj******@club-internet.fr> wrote in message
news:43***********************@news.club-internet.fr...
The following program will decode it (somehow):

static void Main(string[] args)
{
string encoded =
"=?utf-8?B?UmHimaXDr+KBv2cgIEzimYLimYDimatpzrU=?="; // eliminate
leading =?utf-8?B? and trailing ?= encoded =
encoded.Substring(10, encoded.Length - 12); // decode base 64
byte[] bytes = Convert.FromBase64String(encoded);
// convert to string
string decoded = System.Text.Encoding.UTF8.GetString(bytes);
// print
Console.WriteLine(decoded);
}

But I get a slightly different result. I get something like
Ra?iXg L???iY
where X looks like a superscript n and Y looks like greek epsilon.

I don't know how you will be able to make sense out of the result.


I most certainly can. That is excellent work. Thank you very much.
You are worth your weight in gold. What I was missing was this...
// eliminate leading =?utf-8?B? and trailing ?=


It was a pleasure to get assistance from someone who knows what
they're doing instead of those who only pretend to know. Now I'm off
to conquer the world. Have a nice weekend, sir.

Regards,
Harold.


Here it is, Bruno:

Dim sIn As String
Dim sOut As String

sIn = Encoding.UTF8.GetString( _
Convert.FromBase64String("UmHimaXDr+KBv2cgIEzimYLi mYDimatpzrU="))

sOut = ""
For Each c As Char In sIn
sOut = sOut & Encoding.UTF8.GetChars(Encoding.ASCII.GetBytes(c))
Next

I now have two strings, one that displays correctly for systems that support
unicode and one that displays as I want it for systems that don't support
unicode.

Again, many thanks for your kind help.


Nov 23 '05 #13
now just learn now to treat people yourself... calling people linux idiots
or what not is stupid... especially since linux people work with UTF-8 and
base 64 a LOT more then windows people ever would...
Nov 23 '05 #14
Harold Skeggs wrote:
"mayayana" <mayayanaX...@mindXXspring.com> wrote in message
I can't make any sense out of your question either,


Oh, so you're stupid too.


Nothing like biting the hand that is trying to feed you.

I thought you might be Troglodyte:
http://redwing.hutman.net/~mreed/war...troglodyte.htm

And I can't rule out Enfant Provocateur:
http://redwing.hutman.net/~mreed/war...rovocateur.htm

But I really think you are simply Jerk:
http://redwing.hutman.net/~mreed/warriorshtm/jerk.htm

Austin

Nov 23 '05 #15
On Fri, 11 Nov 2005 22:41:03 +1100, Harold Skeggs wrote:

With me being a right cunt ....


I must commend you for heeding Socrates' wise recommendation, "Know
Thyself." I will follow up by suggesting you reinterpret it using the
biblical connotation of the active verb.
Nov 23 '05 #16

Ross Presser wrote:
On Fri, 11 Nov 2005 22:41:03 +1100, Harold Skeggs wrote:

With me being a right cunt ....


I must commend you for heeding Socrates' wise recommendation, "Know
Thyself." I will follow up by suggesting you reinterpret it using the
biblical connotation of the active verb.


Not agreeing or disagreeing with the comment, but *damn* that was
cleverly stated. :-)

Nov 23 '05 #17
"Brian Henry" <no****@nospam.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl
now just learn now to treat people yourself... calling people linux
idiots or what not is stupid... especially since linux people work
with UTF-8 and base 64 a LOT more then windows people ever would...


Hey, if you want a fight, just come right out and say it, you fuck-knuckled
moron. I see all you did in this thread was excel at failure to understand.
Nov 23 '05 #18
"Ross Presser" <rp******@NOSPAMgmail.com.invalid> wrote in message
news:6m***************@rosspresser.dyndns.org
On Fri, 11 Nov 2005 22:41:03 +1100, Harold Skeggs wrote:

With me being a right cunt ....


I must commend you for heeding Socrates' wise recommendation, "Know
Thyself." I will follow up by suggesting you reinterpret it using
the biblical connotation of the active verb.


And I'll just say go and fuck yourself.
Nov 23 '05 #19
"Mike Hofer" <kc********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com
Ross Presser wrote:
On Fri, 11 Nov 2005 22:41:03 +1100, Harold Skeggs wrote:

With me being a right cunt ....


I must commend you for heeding Socrates' wise recommendation, "Know
Thyself." I will follow up by suggesting you reinterpret it using
the biblical connotation of the active verb.


Not agreeing or disagreeing with the comment, but *damn* that was
cleverly stated. :-)


Not really. It's old and only a pubic hair short of being a cliché.


Nov 23 '05 #20
*PLONK*

--
Dag.
Nov 23 '05 #21
On 11 Nov 2005 10:39:18 -0800, Mike Hofer wrote:
Ross Presser wrote:
On Fri, 11 Nov 2005 22:41:03 +1100, Harold Skeggs wrote:

With me being a right cunt ....


I must commend you for heeding Socrates' wise recommendation, "Know
Thyself." I will follow up by suggesting you reinterpret it using the
biblical connotation of the active verb.


Not agreeing or disagreeing with the comment, but *damn* that was
cleverly stated. :-)


Thanks, I was kinda proud of it. :-) But pride goeth before a fall --
*THUD*
Nov 23 '05 #22

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6831
by: Travers Naran | last post by:
Here's the basic idea. I have a dictionary of substrings (the substrings stored as keys). I have a list of strings. I want to find out, for each word in the dictionary, how many times the substring occurs non-overlapping occurrences there are in the list of strings. This is the best I could come up with: for j in self.dict.keys(): c =...
22
2271
by: Jim Hubbard | last post by:
I am reposting a portion of a thread that I am involved in under a new topic because it seems that there are still people that believe the whole "DLL Hell" myth. I hope I can shed some light on this deception for some..... "Michael A. Covington" <look@ai.uga.edu.for.address> wrote in message news:%23tKbygELFHA.576@TK2MSFTNGP15.phx.gbl......
3
1663
by: Aaron Walker | last post by:
I have a feeling this going to end up being something so stupid, but right now I'm confused as hell. I'm trying to code a function, that given a string and a delimiter char, returns a vector of the sub-strings. Here's what I have (I've thrown a main() in there for this mail). --- #include <iostream> #include <string>
20
1760
by: JS | last post by:
I can't seem to figure out how to send a string as a paramenter to a function. I have this structure: struct list { char thread; struct list *previous; struct list *next; };
3
1259
by: darrel | last post by:
Often, I want to use a string in multiple functions on a page. I can declare and re-set the string in each function, or I can just delcare the string outside of the individual functions so that they can all see it. This works fine. My question is if there is any reason NOT to go ahead and declare ALL strings at the top? Is there a...
31
1767
by: Tomás | last post by:
When you have compile-time strings like: "The file is of unknown format." What kind of variables do you use to store it? At the moment I'm using: char const str = "The file is of unknown format."; Do some of you use:
3
2272
by: Bob | last post by:
Over the life of a distributed app, it is possible for the connection string that it was configured with initailly needs to change. You can't scope a connection string setting to user so that it can be changed easily by user for use with MY namespace. If it scoped to application, it can't be changed by the user. Is the only way to modify an...
19
3083
by: pkirk25 | last post by:
I wonder if anyone has time to write a small example program based on this data or to critique my own effort? A file called Realm List.html contains the following data: Bladefist-Horde Nordrassil-Horde Draenor-Alliance Nordrassil-Alliance Nordrassil-Neutral Draenor-Horde
95
4967
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ____________________________________ | | | ------------------ ...
6
1869
by: | last post by:
Hi, I used extensively python and now I find this mess with strings, I can't even reproduce tutorial examples: File "<stdin>", line 0 ^ SyntaxError: 'ascii' codec can't decode byte 0xc4 in position 1: ordinal not in range(128) Is there any good guide to this mess of codecs and hell ?
0
7329
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7253
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7604
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3316
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
890
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.