Fossil

Check-in [b33032ae]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Back out the [ab934c6b09fd1d5] change. Do not change the console output mode using SetConsoleOutputCP(). Go back to converting UTF8 into MBCS upon output.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | windows-i18n
Files: files | file ages | folders
SHA1: b33032ae401a8d6cfdc6d27f1699d28386710364
User & Date: drh 2011-05-12 12:13:25
Context
2011-05-12
12:14
Pull the latest changes from trunk into windows-i18n. check-in: f25b6c00 user: drh tags: windows-i18n
12:13
Back out the [ab934c6b09fd1d5] change. Do not change the console output mode using SetConsoleOutputCP(). Go back to converting UTF8 into MBCS upon output. check-in: b33032ae user: drh tags: windows-i18n
2011-05-10
13:38
Translate check-in comments received from console input from MBCS into UTF8. check-in: 2278ef0f user: drh tags: windows-i18n
2011-05-09
15:50
Pull the latest trunk changes over into the windows-i18n branch. check-in: bbba1608 user: drh tags: windows-i18n
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#include "config.h"
#include "main.h"
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _WIN32
#include <windows.h>
#endif


#if INTERFACE

/*
** Number of elements in an array
*/
................................................................................
  int rc;
  int i;

  sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
  g.now = time(0);
  g.argc = argc;
  g.argv = argv;
#if defined(_WIN32)
  for(i=0; i<argc; i++) g.argv[i] = fossil_mbcs_to_utf8(argv[i]);
  SetConsoleOutputCP(65001);
#endif
  if( getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
    zCmdName = "cgi";
  }else if( argc<2 ){
    fossil_fatal("Usage: %s COMMAND ...\n"
                 "\"%s help\" for a list of available commands\n"
                 "\"%s help COMMAND\" for specific details\n",
                 argv[0], argv[0], argv[0]);







<
<
<







 







<

<
<







21
22
23
24
25
26
27



28
29
30
31
32
33
34
...
231
232
233
234
235
236
237

238


239
240
241
242
243
244
245
#include "config.h"
#include "main.h"
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>





#if INTERFACE

/*
** Number of elements in an array
*/
................................................................................
  int rc;
  int i;

  sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
  g.now = time(0);
  g.argc = argc;
  g.argv = argv;

  for(i=0; i<argc; i++) g.argv[i] = fossil_mbcs_to_utf8(argv[i]);


  if( getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
    zCmdName = "cgi";
  }else if( argc<2 ){
    fossil_fatal("Usage: %s COMMAND ...\n"
                 "\"%s help\" for a list of available commands\n"
                 "\"%s help COMMAND\" for specific details\n",
                 argv[0], argv[0], argv[0]);

Changes to src/printf.c.

804
805
806
807
808
809
810












811




812
813
814
815
816
817
818
** Write to standard output or standard error.
**
** On windows, transform the output into the current terminal encoding
** if the output is going to the screen.  If output is redirected into
** a file, no translation occurs.  No translation ever occurs on unix.
*/
void fossil_puts(const char *z, int toStdErr){












  fwrite(z, 1, strlen(z), toStdErr ? stderr : stdout);




}

/*
** Write output for user consumption.  If g.cgiOutput is enabled, then
** send the output as part of the CGI reply.  If g.cgiOutput is false,
** then write on standard output.
*/







>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>







804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
** Write to standard output or standard error.
**
** On windows, transform the output into the current terminal encoding
** if the output is going to the screen.  If output is redirected into
** a file, no translation occurs.  No translation ever occurs on unix.
*/
void fossil_puts(const char *z, int toStdErr){
#if defined(_WIN32)
  extern char *sqlite3_win32_utf8_to_mbcs(const char*);
  static int once = 1;
  static int istty[2];
  char *zToFree = 0;
  if( once ){
    istty[0] = _isatty(fileno(stdout));
    istty[1] = _isatty(fileno(stderr));
    once = 0;
  }
  assert( toStdErr==0 || toStdErr==1 );
  if( istty[toStdErr] ) z = zToFree = sqlite3_win32_utf8_to_mbcs(z);
  fwrite(z, 1, strlen(z), toStdErr ? stderr : stdout);
  free(zToFree);
#else
  fwrite(z, 1, strlen(z), toStdErr ? stderr : stdout);
#endif
}

/*
** Write output for user consumption.  If g.cgiOutput is enabled, then
** send the output as part of the CGI reply.  If g.cgiOutput is false,
** then write on standard output.
*/