Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: UNICODE QUESTION?


Message #1 by "Leo" <leo@i...> on Fri, 6 Oct 2000 16:50:18 -0400
劉雅雯

好多謝你的幫忙,等我試試你的程式,真的十分感激!

Leo

-----Original Message-----
From: 劉雅雯 [mailto:Irene.Ang@A...]
Sent: Monday, October 09, 2000 5:54 AM
To: sql language
Subject: [sql_language] RE: UNICODE QUESTION?



There no ASP function that directly converts an ansi string to unicode. You
might need to encapsulate the C++ API into a com object that would be use by
your ASP script.


The code below  might help.

void CMessage::AnsiStringToUnicode(LPWSTR lpsUnicode, LPSTR  lpsAnsi, DWORD
nSize)
{
    if (lpsUnicode == NULL)
    {
        return;
    }

    assert(lpsAnsi != NULL);

    size_t rc = mbstowcs(lpsUnicode, lpsAnsi, nSize);
    assert(rc != (size_t)(-1));
    if (lpsUnicode[nSize-1] != L'\0')
        lpsUnicode[nSize] = L'\0';
}


Regards,
Irene
-----Original Message-----
From: Leo [mailto:leo@i...]
Sent: Saturday, October 07, 2000 4:50 AM
To: sql language
Subject: [sql_language] UNICODE QUESTION?


Hi everyone,

We are trying to make a website in multilanguage, on our

Server Side:
Windows 2000 Server English Version,
SQL 7 English Standard Version installed with Character set: 950 CHINESE
TRADITIONAL CODE

Client Side:
Windows 2000 Professional Chinese Version,
SQL 7 English Desktop Version installed with Character set: 950 CHINESE
TRADITIONAL CODE

We have a table called "ONE" with a NVARCHAR column name "ABC"
Then we inputted some CHINESE DATA into the ABC Column.
In the Query Analyzer we have no trouble getting the Chinese Data Back,

SELECT ABC from ONE
WHERE RTRIM(ABC) LIKE('xxx')

NOTE: xxx = CHINESE Character

but once we input the text into the search box in an ASP page through a web
browser,
the SQL returns no data from the server.
It shows all the Chinese data when we SELECT * from TABLE.
The LIKE function just doesn't perform for a particular row that we are
looking for.
I am thinking that may be there is an ASP function to convert an ANSI string
to UNICODE String,
or I have to do something in SQL server?
PLEASE HELP!!!

Leo


  Return to Index