netsurf/riscos
John Mark Bell 23fb72ea6b The core code has always assumed a locale of "C".
Do not change the locale globally, else things will break in weird and 
wonderful ways.

Introduce utils/locale.[ch], which provide locale-specific wrappers for various 
functions (currently just the <ctype.h> ones).

Fix up the few places I can see that actually require that the underlying 
locale is paid attention to.

Some notes:

  1) The GTK frontend code has not been touched. It is possible that reading of 
     numeric values (e.g. from the preferences dialogue) may break with this 
     change, particularly in locales that use something other than '.' as their
     decimal separator.
  2) The search code is left unchanged (i.e. assuming a locale of "C"). 
     This may break case insensitive matching of non-ASCII characters. 
     I doubt that ever actually worked, anyway. In future, it should use
     Unicode case conversion to achieve the same effect.
  3) The text input handling in the core makes use of isspace() to detect
     word boundaries. This is fine for western languages (even in the C locale,
     which it's currently assuming). It will, however, break for CJK et. al. 
     (this has always been the case, rather than being a new issue)
  4) text-transform uses locale-specific variants of to{lower,upper}. In future
     this should probably be performing Unicode case conversion. This is the
     only part of the core code that makes use of locale information.

In future, if you require locale-specific behaviour, do the following:

  setlocale(LC_<whatever>, "");
  <your operation(s) here>
  setlocale(LC_<whatever>, "C");

  The first setlocale will change the current locale to the native environment.
  The second setlocale will reset the current locale to "C".
  Any value other than "" or "C" is probably a bug, unless there's a really
  good reason for it.

In the long term, it is expected that all locale-dependent code will reside in 
platform frontends -- the core being wholly locale agnostic (though assuming 
"C" for things like decimal separators).


svn path=/trunk/netsurf/; revision=4153
2008-05-13 14:37:44 +00:00
..
configure Increase default font size and line spacing. 2007-12-09 11:13:25 +00:00
gui Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
401login.c The core code has always assumed a locale of "C". 2008-05-13 14:37:44 +00:00
artworks.c Update status bar when standalone images are done. 2008-03-10 12:41:41 +00:00
artworks.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
assert.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
awrender.s Add GCCSDK 4 support (cross-compile, static ELF only atm); Ignore codedocs directory during 'svn status'. 2008-03-22 00:49:56 +00:00
bitmap.c Save non-opaque images with a proper mask/full alpha channel 2008-03-24 01:35:13 +00:00
bitmap.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
buffer.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
buffer.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
configure.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
configure.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
cookies.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
cookies.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
debugwin.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
dialog.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
dialog.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
download.c The core code has always assumed a locale of "C". 2008-05-13 14:37:44 +00:00
draw.c Update status bar when standalone images are done. 2008-03-10 12:41:41 +00:00
draw.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
filetype.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
font.c const fixes in plotters and history core 2008-04-07 11:15:09 +00:00
global_history.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
global_history.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
gui.c - riscos/gui.c(path_to_url): escape the characters which need to be escaped when converting the host path to file: URL. 2008-04-02 00:43:51 +00:00
gui.h const fixes in plotters and history core 2008-04-07 11:15:09 +00:00
help.c Allow interactive help to be turned off (implement 1793020) 2007-10-10 21:22:36 +00:00
help.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
history.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
hotlist.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
image.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
image.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
menus.c Add url_fragment to extract fragment from URL 2008-02-03 12:04:48 +00:00
menus.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
message.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
message.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
options.h Periodically reflow the page while fetching a page's objects. Make buffer all rendering default. 2008-02-29 23:03:26 +00:00
oslib_pre7.h Foresee OSLib 7 and pre-OSLib 7 compatibility 2008-03-10 00:51:51 +00:00
palettes.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
palettes.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
plotters.c const fixes in plotters and history core 2008-04-07 11:15:09 +00:00
plugin.c The core code has always assumed a locale of "C". 2008-05-13 14:37:44 +00:00
plugin.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
print.c const fixes in plotters and history core 2008-04-07 11:15:09 +00:00
print.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
query.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
query.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
save.c Fix makefile for save text. Remove redundant ifdef. 2008-04-13 22:23:04 +00:00
save.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
save_complete.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
save_complete.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
save_draw.c Implement ro_save_draw_path() to enable Draw export of SVGs. 2007-12-11 04:07:35 +00:00
save_draw.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
schedule.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
search.c Fix recursion when search string is pure wildcard 2007-10-15 22:48:24 +00:00
sprite.c Update status bar when standalone images are done. 2008-03-10 12:41:41 +00:00
sprite.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
sslcert.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
textarea.c Foresee OSLib 7 and pre-OSLib 7 compatibility 2008-03-10 00:51:51 +00:00
textarea.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
textselection.c Tidy up. 2008-03-31 18:59:23 +00:00
textselection.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
theme.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
theme.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
theme_install.c Launch redirects to unsupported URLs in other applications. 2008-04-19 11:07:42 +00:00
thumbnail.c Foresee OSLib 7 and pre-OSLib 7 compatibility 2008-03-10 00:51:51 +00:00
thumbnail.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
tinct.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
treeview.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
treeview.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
ucstables.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
ucstables.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
uri.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
uri.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
url_complete.c Probably fix crash on clicking in url completion dialogue. 2007-08-29 00:27:52 +00:00
url_complete.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
url_protocol.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
url_protocol.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
wimp.c The core code has always assumed a locale of "C". 2008-05-13 14:37:44 +00:00
wimp.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
wimp_event.c Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
wimp_event.h Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text 2007-08-08 16:16:03 +00:00
window.c Foresee OSLib 7 and pre-OSLib 7 compatibility 2008-03-10 00:51:51 +00:00