B
Bert Szoghy
Hello,
I am struggling with an extended stored procedure DLL coded in C. The
SQL Server database contains French accented characters. The DLL drops
them as it passes on the data to managed code.
I'm trying to wrap my mind around the wchar_t data type.
I tried doing a simple EXE which compiles and runs on Visual Studion
..NET 2003:
#include <string.h>
void main()
{
char xml[100] = "hello";
strcat(xml," world");
printf("%s",xml);
}
I wanted to do the same with wide characters. The following compiles
but chokes on the second line when run:
#include <string.h>
#include <wchar.h>
void main()
{
wchar_t * xml = "hello";
wcscat(xml," là mondé");
// The 2 accented characters above might show up wrong when posted,
on a web page
// the special HTML characters are à and é
sprintf("%s",xml);
}
What would be the working code? Scoured the refs (K&R, C Unleashed)
they were unhelpful.
URLs would be welcome.
Thanks in advance!
Bert
I am struggling with an extended stored procedure DLL coded in C. The
SQL Server database contains French accented characters. The DLL drops
them as it passes on the data to managed code.
I'm trying to wrap my mind around the wchar_t data type.
I tried doing a simple EXE which compiles and runs on Visual Studion
..NET 2003:
#include <string.h>
void main()
{
char xml[100] = "hello";
strcat(xml," world");
printf("%s",xml);
}
I wanted to do the same with wide characters. The following compiles
but chokes on the second line when run:
#include <string.h>
#include <wchar.h>
void main()
{
wchar_t * xml = "hello";
wcscat(xml," là mondé");
// The 2 accented characters above might show up wrong when posted,
on a web page
// the special HTML characters are à and é
sprintf("%s",xml);
}
What would be the working code? Scoured the refs (K&R, C Unleashed)
they were unhelpful.
URLs would be welcome.
Thanks in advance!
Bert