Fossil

Check-in [0ff5b5ed]
Login

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

Overview
Comment:unbreak win32
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ticket-e399bc
Files: files | file ages | folders
SHA1: 0ff5b5ed0f6a3934aaa1d5dcd4be3e93bf5eff83
User & Date: jan.nijtmans 2012-11-29 08:57:40
Context
2012-11-29
09:53
Tested now on win32 and cygwin (with some fixes, please evaluate!). I cannot test it on OSX, but I think this should function as intended. check-in: a0148eac user: jan.nijtmans tags: ticket-e399bc
08:57
unbreak win32 check-in: 0ff5b5ed user: jan.nijtmans tags: ticket-e399bc
03:14
Untested changes designed to fix broken filename encodings on MacOS. Move all character-set converting routines into a new file called utf8.c. Add the fossil_filename_to_utf8() routine, which converts Unicode to utf8 on windows and decomposed utf8 into precomposed utf8 on Mac. Ticket [e399bc1edfe45b] check-in: c24e568f user: drh tags: ticket-e399bc
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/utf8.c.

18
19
20
21
22
23
24



25
26
27
28
29
30
31
..
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
** This file contains utilities for converting text between UTF-8 (which
** is always used internally) and whatever encodings are used by the underlying
** filesystem and operating system.
*/
#include "config.h"
#include "utf8.h"
#include <sqlite3.h>




/*
** Translate MBCS to UTF8.  Return a pointer to the translated text.
** Call fossil_mbcs_free() to deallocate any memory used to store the
** returned pointer when done.
*/
char *fossil_mbcs_to_utf8(const char *zMbcs){
................................................................................
#endif
}

/*
** Deallocate any memory that was previously allocated by
** fossil_unicode_to_utf8().
*/
void fossil_unicode_free(char *pOld){
#ifdef _WIN32
  sqlite3_free(zOld);
#else
  /* No-op on unix */
#endif
}

#if defined(__APPLE__)
# include <iconv.h>
................................................................................

/*
** Deallocate any memory that was previously allocated by
** fossil_filename_to_utf8().
*/
void fossil_filename_free(char *pOld){
#if defined(_WIN32)
  sqlite3_free(zOld);
#elif defined(__APPLE__)
  fossil_free(zOld);
#else
  /* No-op on all other unix */
#endif
}

/*
** Display UTF8 on the console.  Return the number of







>
>
>







 







|

|







 







|

|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
** This file contains utilities for converting text between UTF-8 (which
** is always used internally) and whatever encodings are used by the underlying
** filesystem and operating system.
*/
#include "config.h"
#include "utf8.h"
#include <sqlite3.h>
#ifdef _WIN32
# include <windows.h>
#endif

/*
** Translate MBCS to UTF8.  Return a pointer to the translated text.
** Call fossil_mbcs_free() to deallocate any memory used to store the
** returned pointer when done.
*/
char *fossil_mbcs_to_utf8(const char *zMbcs){
................................................................................
#endif
}

/*
** Deallocate any memory that was previously allocated by
** fossil_unicode_to_utf8().
*/
void fossil_unicode_free(void *pOld){
#ifdef _WIN32
  sqlite3_free(pOld);
#else
  /* No-op on unix */
#endif
}

#if defined(__APPLE__)
# include <iconv.h>
................................................................................

/*
** Deallocate any memory that was previously allocated by
** fossil_filename_to_utf8().
*/
void fossil_filename_free(char *pOld){
#if defined(_WIN32)
  sqlite3_free(pOld);
#elif defined(__APPLE__)
  fossil_free(pOld);
#else
  /* No-op on all other unix */
#endif
}

/*
** Display UTF8 on the console.  Return the number of