Re: Char to Wide-Char tool

From: Geoff Back (GEOFF@autocue.mhs.compuserve.com)
Date: Sat Mar 23 1996 - 16:29:13 EST


>
> I am looking for a tool which will take a C source file using traditional
> character strings and convert it a wide-character based source file. As an
> example, the tool would convert:
>
> char name[10]; -> wchar_t name[10];
> strcpy(name, "Joe"); -> wstrcpy(name, L"Joe");

Write a 'sed' script. Something along these lines:

----------------8<--------------------8<-------------------8<
s/char/wchar_t/g
s/strcpy/wcscpy/g
s/strlen/wcslen/g
s/strcat/wcscat/g
.....
.....
s/strnicmp/wcsnicmp/g

etc.

I am assuming that you are using UNIX, Windows NT or some other 'sensible'
OS, in which case tools such as SED are easily available.

Cheers,

   -- Geoff.
================================================================
 Geoff Back GEOFF @ AUTOCUE via CSERVE or NHUB
 Internet: geoff @ autocue.mhs.compuserve.com
 E-Mail administrator via ADMIN @ AUTOCUE
================================================================



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:30 EDT