Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Accented vb strings in asp

Reply
Thread Tools

Accented vb strings in asp

 
 
Pedro Silva
Guest
Posts: n/a
 
      04-15-2004
Hi,

I'm trying to send an e-mail message from a VB variable, which
contains accented characters, like this:

dim str = "Acentuação" ' this string contains a c-cedilla and an
a-tilde
dim objMail As New MailMessage()
objMail.Body = str
[...] 'all other objMail property settings follow

The message is delivered OK, but all the accented characters appear as
2 characters. The str string above would show like 'Acentuação'.

I know this is due to all VB variables being unicode and text e-mail
not supporting it, but I'd already tried all possible encodings and it
didn't help.

Now I'm noticing that the same thing happens when I write an accented
vb string to my database.

I'd greatly appreciate any help.

Thanx,

Paulo
 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      04-15-2004
What DBMS?
How are you entering the problem string (html form, direct db update,...)?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Pedro Silva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi,
>
> I'm trying to send an e-mail message from a VB variable, which
> contains accented characters, like this:
>
> dim str = "Acentuação" ' this string contains a c-cedilla and an
> a-tilde
> dim objMail As New MailMessage()
> objMail.Body = str
> [...] 'all other objMail property settings follow
>
> The message is delivered OK, but all the accented characters appear as
> 2 characters. The str string above would show like 'Acentuação'.
>
> I know this is due to all VB variables being unicode and text e-mail
> not supporting it, but I'd already tried all possible encodings and it
> didn't help.
>
> Now I'm noticing that the same thing happens when I write an accented
> vb string to my database.
>
> I'd greatly appreciate any help.
>
> Thanx,
>
> Paulo



 
Reply With Quote
 
 
 
 
Pedro Silva
Guest
Posts: n/a
 
      04-17-2004
Hi Mark,

I'm using MS SQL SERVER 7.

The interesting thing is that when the data comes from in inpu filed
(html form), it works ok (the accents are preserved in the database).
But When I do something like:

dim str as string = "Acentuação"
dim sqlstr as string = "UPDATE MyDB SET aField = " + str + "WHERE
keyField = 'KeyValue'"

and run this SQL statement, I get 'Acentuação' in the database
field.

I can't change the database collation, and I don't think it's a good
idea to change the filed type to unicode char, because then when it
comes from the form fileds it wouldn't work (or would it?)

Thanx for your help.

"Mark Schupp" <(E-Mail Removed)> wrote in message news:<uGLE$(E-Mail Removed)>...
> What DBMS?
> How are you entering the problem string (html form, direct db update,...)?
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "Pedro Silva" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > Hi,
> >
> > I'm trying to send an e-mail message from a VB variable, which
> > contains accented characters, like this:
> >
> > dim str = "Acentuação" ' this string contains a c-cedilla and an
> > a-tilde
> > dim objMail As New MailMessage()
> > objMail.Body = str
> > [...] 'all other objMail property settings follow
> >
> > The message is delivered OK, but all the accented characters appear as
> > 2 characters. The str string above would show like 'Acentuação'.
> >
> > I know this is due to all VB variables being unicode and text e-mail
> > not supporting it, but I'd already tried all possible encodings and it
> > didn't help.
> >
> > Now I'm noticing that the same thing happens when I write an accented
> > vb string to my database.
> >
> > I'd greatly appreciate any help.
> >
> > Thanx,
> >
> > Paulo

 
Reply With Quote
 
Paulo Góes
Guest
Posts: n/a
 
      04-18-2004
Mark

I finally figured out (took me 1 week of research and hard work) that all I had to do was add a culture=pt-BR in my web.config. In my research I naturally delt with internalization and localization issues, but it seemed too complicated, and I didn't see my application as international anyway (it only runs on one language). But in the end it seems that if you use any non-English characters in your code you'd better use this culture option

Thanks for your help

Paulo

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accented charcters in Asp.net charvind ASP .Net 0 08-13-2008 04:51 PM
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
Text search with accented characters Mickey Segal Java 3 12-16-2005 03:34 AM
literal accented characters in python asp page with Microsoft IIS nicolas_riesch Python 2 08-23-2005 03:19 PM
accented characters Davide Benini XML 4 06-01-2005 03:06 PM



Advertisments