Friday, March 9, 2012

French Accent

Using MSDE 2000

I made a script to create my database and insert default values in some tables. The problem is that all the accent are replace by junk ("Unitús instead of Units"). But if I insert values with Server Explorer, ADO.Net or oSql it work fine...

Anyone as an idea on why accent are replace by junk only when insertion are made by a script.

Thanks

What is the collation and system locale when used this script?

I think there used to be problem with French collation in SQL 2000, You either have to support all collations or force your clients to reinstall SQL Server with the collation you chose. It is not quite clear why French data in French_CI_AS collation and Latin1_General_CI_AS collation are incompatible.

|||

I use the collation "SQL_Latin1_General_CP1_CI_AS". I also tried with the collation "French_CI_AS" but I had the same result.

|||

I've just installed Sql Server 2005 Express and I have the same problem. So this is not a Sql Server 2000 issue.

Here's a part of the database creation script:

Code Snippet

-- SQL Manager 2005 Lite for SQL Server (2.4.0.1)
--
-- Host : MyHost
-- Database : MyDatabase
-- Version: : Microsoft SQL Server 9.00.1399.06

DROP DATABASE MyDatabase
GO

CREATE DATABASE [MyDatabase]
COLLATE SQL_Latin1_General_CP1_CI_AS
GO

USE [MyDatabase]
GO

--
-- Structure for table Langues :
--

CREATE TABLE [dbo].[Langues] (
[id] int NOT NULL,
[langue] varchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[description] varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
)
ON [PRIMARY]
GO

--
-- Data for table Langues (LIMIT 0,500)
--

INSERT INTO [dbo].[Langues] ([id], [langue], [description])
VALUES
(1, 'En', 'Rules')
GO

INSERT INTO [dbo].[Langues] ([id], [langue], [description])
VALUES
(1, 'Fr', 'Règlementations')
GO

INSERT INTO [dbo].[Langues] ([id], [langue], [description])
VALUES
(2, 'En', 'Repairs')
GO

INSERT INTO [dbo].[Langues] ([id], [langue], [description])
VALUES
(2, 'Fr', 'Rparations')
GO


ALTER TABLE [dbo].[Langues]
ADD CONSTRAINT [PK_Langues]
PRIMARY KEY CLUSTERED ([id], [langue])
WITH (
PAD_INDEX = OFF,
IGNORE_DUP_KEY = OFF,
STATISTICS_NORECOMPUTE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO

-- END OF THE SCRIPT

When I open server explorer to view the data I get

- "Rúparations" instead of "Rparations"

- "RTglementations" instead of "Règlementations"

I haven't figure out why so far...

Thanks

|||

I finally found the problem. It had nothing to do with sql server... my script file was save under the ANSI encoding instead of UNICODE. Dumb problem

Thanks for your time.

No comments:

Post a Comment