//
// Setting this to true will enable admins to edit any post at any time
// $CFG->admineditalways = true;
+//
+// This setting will put Moodle in Unicode mode. It's very new and
+// most likely doesn't work yet. THIS IS FOR DEVELOPERS ONLY, IT IS
+// NOT RECOMMENDED FOR PRODUCTION SITES
+// $CFG->unicode = true;
$output = "<select name=\"$name\" $javascript>\n";
if ($nothing) {
$output .= " <option value=\"$nothingvalue\"\n";
- if ($nothingvalue == $selected) {
+ if ($nothingvalue === $selected) {
$output .= " selected=\"true\"";
}
$output .= ">$nothing</option>\n";
// Add a stylesheet for the HTML editor
$meta = "<style type=\"text/css\">@import url($CFG->wwwroot/lib/editor/htmlarea.css);</style>\n$meta\n";
- // Specify character set ... default is iso-8859-1 but some languages might need something else
- // Could be optimised by carrying the charset variable around in $USER
- if (current_language() == "en") {
- $meta = "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />\n$meta\n";
+ // Character set could be optimised by carrying the charset variable around in $USER
+ if (!empty($CFG->unicode)) {
+ $encoding = "utf-8";
+ } else if (!empty($SESSION->encoding)) {
+ $encoding = $SESSION->encoding;
} else {
- $meta = "<meta http-equiv=\"content-type\" content=\"text/html; charset=".get_string("thischarset")."\" />\n$meta\n";
+ $encoding = get_string("thischarset");
}
+ $meta = "<meta http-equiv=\"content-type\" content=\"text/html; charset=$encoding\" />\n$meta\n";
if ( get_string("thisdirection") == "rtl" ) {
$direction = " dir=\"rtl\"";