Hello,
For my app, with data in SQL-Server 2012, I cannot have all letter
correctly written.
First, in SQL-Server, there are 2 types for storing a string :
* char and varchar are string types with "old" charset, ie not uniccode,
and dependant on the site.
* nchar, nvarchar are string types with unicode. We can store text from
our country, but also stranger text.
For me, in France, the database is declared "Collation = French_Cl_AS",
this is équivalent to "Latin1".
For my app, I use all types of data :
a "code" is allways varchar(12), for example Supplier-code, Article-code,
Supplier-address, accounting-acct, name of persons, ...
but a comment field can countain many thing.
I think I've tried all combinations to convert my app. Each combination
works for a part, but doen't work in another part.
For both case, I have :
a => I already have data in my database, that are put from MS-Access, or
directly from "SQL Server Management studio" (parameters list, to use with
drop-down fields)
In my database, I have data like "Frais Généraux", "Certificat de
confirmité", .... The app has not to change this values
I also have data that are a request that joins data from my app
database, and my ERP-database (list of suppliers with address like "Saint
Nom la Bretèche".
b => I try to type a sentence in my SQLFORM, and this data is written in
the database.
The sentence is ==> l ' élève est dans la forêt, où ça ?
I write it in 2 fields, one in varchar, the other in nvarchar.
First, I set in the DAL "db_codec='Latin1' "
1a - All that data are well displayed in my app.
1b - For both fields, when I display the form, the systems shows ==>
L'élève est dans la forêt, où ça ?
And into the database, when I display it ==> L'élève est dans la
forêt, où ça ?
And if I request data from another tool (MS-Excel, that connects to
the same database with an MS-Query), I also get L'élève est dans la
forêt, où ça ?
If I "valid" the form twice (the displayed data are unchanged), I
get L'élève est dans la forêt, où ça ?
Second, if I set the DAL with UTF-8 (so without any codec):
2a - The existing data (typed in Sqlserver Management Studio, or a request
from different data including ERP) are not correct
==> Frais g�n�raux
2b - For my favorite sentence (l'élève est dans la forêt, où ça ?), this is
correctly shown when I display it again in the SQLFORM.
But when I extract data with a third-party tool, or look at the data with
MS-Man-Studio, I get :
==> L'élève est dans la forêt, où ça ?
The codec "Latin1" seems to be best :
OK => I can display data from other tables (that comes from other tools,
like ERP, or MS-Access apps)
OK => When a field already contains a sentence, it's correctl displayed
(codec can very well DE-code the Latin1)
Not OK : when the use type a sentence in an SQLFORM, this sentence is bad
EN-coded to Latin1.
Curiosly, the result is exactly the same with varchar fields and nvarchar
fields. I'm surprised of this.
I've read a lot af things, and many post about codec and ODBC-link with
MS-SQL.. I don't find the solution for my case.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.