Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Umlaut output as question mark...

Status
Not open for further replies.

steverbs

Programmer
Jul 17, 2003
253
0
0
GB
Hi all.

I am extracting information from an MSSQL DB and using VB to manipulate it and output it to text. The problem is that what should appear as 'Gebrüder' is output as 'Gebr?der'. Any ideas on what could cause this?

Thanks.

Stephen.
 
There are two common reasons for this:
1. You're using a non-Unicode aware font. Try switching to MS Arial Unicode (comes with Office)

2. You're reading data in one encoding (maybe Latin-1) and not running it through an instance of the Encoding family of classes to transform it into Unicode.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I didn't realise that I'd have to manually alter the text Encoding, but I have a feeling that it is probably the latter as the characters show up just fine in the VS.NET debugger, but not in the text document. I've just had a flick through the MSDN docs and have found the Encoding Class. Is this what I am after? The DB Collation is Latin1 so would I need to process it?

Thanks for the help.

Stephen.
 
What's the column type in SQL Server? To store Unicode data it needs to be one of the "N" family: NCHAR NVARCHAR NTEXT.

Your ADO.NET parameter object (if you're using one, and you probably should be for other reasons) needs to be SqlDbType.NChar, SqlDbType.NVarChar, or SqlDbType.NText

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The type for the problematic fields is nvarchar. I would have imagined that this would be the same in the DataSet which is filled from an Sql DataAdapter.
 
I guess - I don't use DataAdapters, etc., preferring lower-level code.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top