Skip navigation
Sidebar -

Advanced search options →

Welcome

Welcome to CEMB forum.
Please login or register. Did you miss your activation email?

Donations

Help keep the Forum going!
Click on Kitty to donate:

Kitty is lost

Recent Posts


Qur'anic studies today
April 23, 2024, 06:50 AM

Do humans have needed kno...
April 20, 2024, 12:02 PM

Lights on the way
by akay
April 19, 2024, 04:40 PM

اضواء على الطريق ....... ...
by akay
April 19, 2024, 12:50 PM

Do humans have needed kno...
April 19, 2024, 04:17 AM

What's happened to the fo...
by zeca
April 18, 2024, 06:39 PM

New Britain
April 18, 2024, 05:41 PM

Iran launches drones
April 13, 2024, 09:56 PM

عيد مبارك للجميع! ^_^
by akay
April 12, 2024, 04:01 PM

Eid-Al-Fitr
by akay
April 12, 2024, 12:06 PM

Mock Them and Move on., ...
January 30, 2024, 10:44 AM

Pro Israel or Pro Palesti...
January 29, 2024, 01:53 PM

Theme Changer

 Topic: character set

 (Read 6968 times)
  • 12 Next page « Previous thread | Next thread »
  • character set
     OP - September 21, 2009, 02:13 PM

    Hi!

    I have noticed that characters sometimes become garbled:

    aring: ??
    aumlaut:??
    oumlaut: ??
    uumlaut: ??

    Also the pound sign: ?

    However, when Aziz typed Scw?nzchen, it seemed to work.

    Any idea where the problem is, on my side or on server side?

    Using FireFox 3.0.10 on WinXP SP2

    /Stefan
  • Re: character set
     Reply #1 - September 21, 2009, 02:44 PM

    The problem lies with the server (encoding issue.) I use a "user script" that permits posting Unicode text here.

    ·äöü€£¢µ„“”

     dance

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: character set
     Reply #2 - September 21, 2009, 03:19 PM

    Test
    Huh?Huh???
  • Re: character set
     Reply #3 - September 21, 2009, 03:19 PM

     ? ?
  • Re: character set
     Reply #4 - September 21, 2009, 03:20 PM

    ? ?
  • Re: character set
     Reply #5 - September 21, 2009, 03:28 PM

    The problem lies with the server (encoding issue.) I use a "user script" that permits posting Unicode text here.

    Huh?Huh?Huh???

     dance


    Is there a way of getting the pound sterling sign up by this method?

    My Book     news002       
    My Blog  pccoffee
  • Re: character set
     Reply #6 - September 21, 2009, 03:32 PM

    Huh?Huh?
  • Re: character set
     Reply #7 - September 21, 2009, 03:38 PM

    trying
    aring ??
    auml ??
    ouml ??
    pound ?
    endtry
  • Re: character set
     Reply #8 - September 21, 2009, 03:39 PM

    2nd try
    aring ??
    endtry
  • Re: character set
     Reply #9 - September 21, 2009, 03:45 PM

    3rd go
    auml ??
    endtry
  • Re: character set
     Reply #10 - September 21, 2009, 03:49 PM

    I installed it and it says it is active. However, when I check with FireBugNet, the posted data is the character, not the code.

    Could this be colliding with NoScript? I have no indication from NoScript that it is forbidding anything. AdBlocker is also not blocking anything.
  • Re: character set
     Reply #11 - September 21, 2009, 04:40 PM

    Okay, I compared my installed script with the one in the attachment in that thread.
    Apparently I have linked to an older version of the file. You have to edit line 20 like so:
    var textarea = form.elements.namedItem(fields[i]);
    The "i" in brackets is missing...


    Edit: Download the file from here: http://salam.googlecode.com/svn/js/coem_unicode.js

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: character set
     Reply #12 - September 21, 2009, 04:54 PM

    aring: åÅ
  • Re: character set
     Reply #13 - September 21, 2009, 04:55 PM

    Excellent. Thanks.
  • Re: character set
     Reply #14 - September 21, 2009, 05:08 PM

    Is there a way of getting the pound sterling sign up by this method?

    Yes, you will be able to type anything that is installed on your machine. £ for example. Also cyrillic: здравствуйте! Greek: Αθηναι Θεσσαλονικι

    Good work Aziz!

    /Stefan
  • Re: character set
     Reply #15 - September 21, 2009, 05:14 PM

    can you explain to me what i need to do to be able to use the sterling sign on my keyboard which currently becomes shows up a ?, as I am a little  Huh?

    My Book     news002       
    My Blog  pccoffee
  • Re: character set
     Reply #16 - September 21, 2009, 05:19 PM

    Follow the link in Aziz' answer (the one behind "user script"), that should guide you. Download version 3. Then apply the fix he described (adding [ i ] ). Then it should work. Remember to install GreaseMonkey first if you are using FF.

    Actually I haven't tried this in IE - never use that for this site.

    /Stefan
  • Re: character set
     Reply #17 - September 21, 2009, 05:37 PM

    You can download the correct file from here now:

    http://salam.googlecode.com/svn/js/coem_unicode.js

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: character set
     Reply #18 - September 21, 2009, 07:41 PM

    I am gettin a 'windows scipt host runtime error' when I click that link..

    My Book     news002       
    My Blog  pccoffee
  • Re: character set
     Reply #19 - September 21, 2009, 07:41 PM

    I use vista & IE8

    My Book     news002       
    My Blog  pccoffee
  • Re: character set
     Reply #20 - September 21, 2009, 07:57 PM

    You poor thing.  grin12

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: character set
     Reply #21 - September 21, 2009, 08:03 PM

    The script error would come from IE trying to execute the file instead of saving it. Try to "Save Target" from the link's menu.

    But if you are using IE I am not sure it will work. I checked and there are a few ways getting the user script concept running under IE (Trixie, IE7Pro, GreaseMonkeyforIE) but I understand it is not 100% the same as with FF. I think I had better leave this to Aziz, who has more experience than I in hacking around like this.

    An alternative is that Oz adds this code to the page on the server side so that all clients get it.
  • Re: character set
     Reply #22 - November 11, 2009, 03:45 AM

    I can't get the letter ? (e-acute) to display itself in my posts, although it works in the preview. Any idea how to fix it?
  • Re: character set
     Reply #23 - December 28, 2009, 01:15 AM

    test

    äöå

    ÄÖÅ
  • Re: character set
     Reply #24 - December 28, 2009, 01:24 AM

    I noticed that the unicode script did not work for private messages. So I fixed it.
    See below.

    /Stefan

    function COEM_addUnicodeSupport()
    {
      // Look at the URL to see if a posting is being written.
      if ((document.URL.indexOf("action=post") == -1) &&
         (document.URL.indexOf("action=pm") == -1) )

       
        return; // Return if not.

      var form = document.getElementById("postmodify"); // Get a short handle to the form.

      // In FF this is the only way it works.
      // First clear the attribute then set an event handler.
      form.setAttribute("onsubmit", ""); // Clear the old handler.
      form.addEventListener("submit", COEM_modifyText, false);
    }
  • Re: character set
     Reply #25 - December 28, 2009, 01:25 AM

    You can download the correct file from here now:

    http://salam.googlecode.com/svn/js/coem_unicode.js

    It wont let me access that link, I get an error saying: Repository access denied.

    An alternative is that Oz adds this code to the page on the server side so that all clients get it.

    Why don't you do this Os? It'd be so much simpler!
  • Re: character set
     Reply #26 - December 28, 2009, 01:36 AM

    The last lot of "adjustments" that were suggested introduced a bug we still haven't been able to get rid of. This is despite manually reversing the code changes. You guys want to beta test your code on another active site and make sure it's 100% bug-free then I might get interested.

    Also, at the moment I'm not really into doing any more with this site because we will be changing software versions pretty soon, so this place is in a holding pattern until then. When the change goes ahead I will be doing a utf-8 conversion so we wont be running on ISO any more anyway. The reason I haven't done it yet is because the earlier versions of the upgrade script had a bug when dealing with utf-8 sites. I think it is safer to stick with ISO for the moment and convert to utf-8 after upgrading.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: character set
     Reply #27 - December 28, 2009, 01:42 AM


    When the change goes ahead I will be doing a utf-8 conversion so we wont be running on ISO any more anyway. ...  I think it is safer to stick with ISO for the moment and convert to utf-8 after upgrading.


    Fair enough.

    Peru and other interested: I enclose the code for manual copy/paste to local file.

    // ==UserScript==
    // @name           COEM Unicode Support
    // @description    Adds support for Unicode characters including Arabic script.
    // @namespace      [url]http://www.councilofexmuslims.com/[/url]
    // @include        [url]http://www.councilofexmuslims.com/index.php[/url]*
    // @version        1.1

    // ==/UserScript==

    // History:
    // 1.1: Fixed script for Firefox.
    // 1.0: First release.

    function COEM_modifyText()
    {
      var fields = ["subject", "message"];
      var form = document.getElementById("postmodify");
      for (i in fields)
      {
        var textarea = form.elements.namedItem(fields[i]);
        textarea.value = COEM_Text2Entities(textarea.value);
      }
      submitonce(this); // Called in the original onsubmit function.
    }

    function COEM_addUnicodeSupport()
    {
      // Look at the URL to see if a posting is being written.
      if ((document.URL.indexOf("action=post") == -1) &&
      (document.URL.indexOf("action=pm") == -1) )

        return; // Return if not.

      var form = document.getElementById("postmodify"); // Get a short handle to the form.

      // In FF this is the only way it works.
      // First clear the attribute then set an event handler.
      form.setAttribute("onsubmit", ""); // Clear the old handler.
      form.addEventListener("submit", COEM_modifyText, false);
    }

    /// Converts Unicode codepoints to numerical entities.
    function COEM_Text2Entities(text)
    {
      var result = "";
      for (var i = 0; i < text.length; i++)
      {
        var charCode = text.charCodeAt(i);
        if (charCode > 127)
          result += "&#" + charCode + ";";
        else
          result += String.fromCharCode(charCode);
      }
      return result;
    }

    /// Not needed at the moment.
    // function COEM_Entities2Text(text)
    // {
    //   function replaceFunction(fullMatch, subMatch1, offset, str) {
    //     return String.fromCharCode(new Number(subMatch1));
    //   }
    //   return text.replace(/&#(\d+);/g, replaceFunction);
    // }

    if (window.opera)
      document.addEventListener("load", COEM_addUnicodeSupport, false); // Opera.
    else
      COEM_addUnicodeSupport(); // Firefox.
  • Re: character set
     Reply #28 - December 28, 2009, 02:11 AM

    I got an error saying:
    Line 66; 'window' is undefined.

    I'm using Windows 7
  • Re: character set
     Reply #29 - December 28, 2009, 10:24 AM

    First of all - you are using Firefox or Opera, right?

    For Firefox:

    First install the Greasemonkey extension.
    Copy the code above into an empty file on your Desktop that you have named coem_unicode.user.js
    Drag the script file from your Desktop on your Firefox browser window. A dialog window should pop up asking whether you want to install it. Confirm and it should work without a restart.

    For Opera, see Aziz' thread "User scripts for this forum".

    /Stefan
  • 12 Next page « Previous thread | Next thread »