Solved

unable to decode spanish character while exporting csv

Posted on 2014-02-18
6
148 Views
Last Modified: 2014-09-25
while exporting csv in windows its decoding Spanish characters correctly.However,in Linux its showing Spanish characters appending extra letters.

I am using SQL Server 2005 for DB storage and Jetty6 as my application. while defining Database i have used Collation "SQL_Latin1_General_CP1_CI_AS" .


In database it is store like" Félix" whereas in csv output is coming "Félix" this.

Please help.

Thank you
0
Comment
Question by:aloknet21
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
Kishan Zunjare earned 30 total points
ID: 39866858
Please check the Data type of  column where you are storing values... it has to NVARCHAR or NTEXT.
0
 
LVL 1

Author Comment

by:aloknet21
ID: 39867174
Yes it is already NVARCHAR. it is like:

first_name(nvarchar(max),not null)
last_name(nvarchar(max),not null)
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39881263
Please check the Data type of  column where you are storing values... it has to NVARCHAR or NTEXT.
This is not correct as anyone knows that uses Spanish.  You do not need unicode in order to support Spanish.  Now if you want to define all the char data types as unicode, that is fine, it is just that you are going to use double the space.
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 1

Author Comment

by:aloknet21
ID: 39894422
Thanks for your reply. We need to get all columns with Spanish Character thats why we are defining all the column as NVARCHAR.

The Linux system is already defined with Unicode.

then also its not working.

Please suggest any exact solution if possible.

Thanks
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39895677
We need to get all columns with Spanish Character thats why we are defining all the column as NVARCHAR.
Once again, this is not correct you do not need Unicode to support Spanish.  A small SQL script would prove this to you and you would not have to repeat this myth over and over.
Now, if you want to use unicode, then more power to you.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39895683
In case you are not familiar with Spanish characters here is an example of a script to show you how nvarchar is not required:
DECLARE @SpanishText TABLE (Value varchar(50))

INSERT  @SpanishText
        (Value)
VALUES  ('Año'),
        ('áéíóúü'),
        ('ÁÉÍÓÚÜ')

SELECT  *
FROM    @SpanishText

Open in new window

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now