Menu

setting pagecodes

Anonymous
2016-02-29
2016-03-06
  • Anonymous

    Anonymous - 2016-02-29

    Dear sir....

    I have downloaded PC-Basic to my computer. It's O.K. However I needed to enter charcters, strings and text in Arabic. It didn't work with me. I understand that relevant codepages=720, but I don't know how or where to set it.
    Could you please let me know how to do that?

    Thank you

    Othman Theni
    email: [--edited--]

     

    Last edit: Rob Hagemans 2016-03-12
  • Rob Hagemans

    Rob Hagemans - 2016-02-29

    Hi, thanks for reaching out! You can set codepage 720 by using a command-line option. (I'm going to assume you use Windows 7 - if you use something else, let me know.) Open a Command Prompt from the start menu and use the following command after the C:> prompt:

    "C:\Program Files (x86)\PC-BASIC\pcbasic.com" --codepage=720
    

    and a PC-BASIC Window will open that is set up to use the Arabic codepage 720. You can then load your program into it.

    By the way, there are several different codepages for Arabic, so if you're not sure which one you need or 720 does not give a sensible result you can also try 864 (DOS Arabic). If it's in another language using the Arabic alphabet you could try iransystem (for Persian), 868 (for Urdu), and pascii (for Persian, Urdu, Sindhi, and Kashmiri)

    Let me know how it goes - I'd like to know if this codepage works correctly but I don't read Arabic myself so it's hard to test for me.

    Thanks!
    Rob

     
    • Anonymous

      Anonymous - 2016-03-01

      Hi Rob
      Thank you for fast reply. I do appreciate it.
      Yes, I,m using windows 7. I have tried to set the codepages as you asked but it didn't work.
      I'll tell how I did it: c:\program files\PC-BASIC\pcbasic.com --codepages=720
      I did it through command prompt in the safe mode. I have started the computer in this mode.
      Whan I enterd the path shown above (exactly as it is written) I got this respond:
      Warning: Ignored unrecognised option "codepages=720)
      and keeps running the program in normal way.
      Perhaps the way to set the pages I did is incorrect. I have tried also 860 and 864 and got the same answer.

      The slashes (--) coming before codepages are confusing to me ??!! do I have to include them or it means something else?

      I didn't use (program files *86) because I have only (program files) in my computer ?

      Looking forward to hearing from you

      O. Othman

       
  • Rob Hagemans

    Rob Hagemans - 2016-03-01

    Hi, your command is almost correct, try it like this:

    c:\program files\PC-BASIC\pcbasic.com --codepage=720
    

    Note that there should be no s at the end of --codepage.

    The double dashes -- do indeed need to be included, and the different name Program Files (x86) is only for 64-bit installations. The warning you showed means you have the correct path for your installation, but there is just the slight typo in the option.

    Hope this helps,
    Rob

     
    • Anonymous

      Anonymous - 2016-03-01

      Hi, At last it worked... However there ar 2 problems:
      1. It writes Arabic words from left to right. which sould be from right to left. Imagine if you write your name boR instead of Rob.
      2. Letters are not connected in the single word. They are typed separate instead of being connected to each others.

      I wonder if you can find a way to sort out this.

      Thank you
      Othman

       
      • Rob Hagemans

        Rob Hagemans - 2016-03-01

        Hi Othman, glad to know it works a bit, and thanks for trying!

        1) I realise this must be extremely annoying, but as far as I understand this is how GW-BASIC worked in Arabic and other right-to-left scripts. People would actually spell their strings backward in the code, as computers at the time were unable to deal with directionality. (Mixing left-to-right and right-to-left is actually a very difficult problem - modern word processors need considerable amounts of code to deal correctly with switching between them. For instance, you'd need to know the width of the string before printing it so that you can leave space).

        2) I'm afraid this also seems very difficult to realise within the setup of PC-BASIC, as it uses a monospaced font with a single symbol per screen cell and a simple chracter set that maps bytes to symbols. It has no sense of context. It would need additional, connected fonts and substitution tables to realise anything like a correct connection between letters - but as far as I understand from online sources DOS and GW-BASIC did not connect Arabic letters either, that functionality only became available with Windows. I may be wrong though, as there isn't much information (that I am able to read) available on 1980s computer use in countries outside America, Europe and the Soviet Union.

        If you have more information on how GW-BASIC and old DOS programs used to deal with Arabic under codepage 720, please let me know - I can then see whether it's possible for me to implement. E.g., are you working with an old BASIC program that expects things to work differently than they do?

        Language support in a DOS-like context is always going to be very far from perfect given how English-centric computers of the 1980s were. When it comes down to it, PC-BASIC only aims to emulate GW-BASIC (and perhaps some helper programs that people at the time used for non-English scripts) so that it is able to run old programs faithfully - it's not trying to be a viable modern development platform at all.

        Rob

         
        • Anonymous

          Anonymous - 2016-03-02

          Hi Rob

          In fact I worked in GW-BASIC along ago and made a program for preparing student documention (registration and transcript). This is along ago in the late 1980s . At that time I used a tool similar to Windows called NAFITHA. This was working o.k. with me as far as Arabic letters are concerned. I can switch the keyboard from English to Arabic by Alt-Shift and change the orientation from right to left by Ctrl-Shift.
          But nowadays I need to run it under windows because Nafitha is not useful for many other applications. A copy of the program is attached. A lot of Arabic text is there but it appears "Garbeg" when you run or list the program in windows or in DOS.

          Thank you

           
          • Rob Hagemans

            Rob Hagemans - 2016-03-02

            Thanks for the program! I can't read the text, but is it indeed the case that both the Arabic and the Latin are encoded in logical order (so the first character of a string appears on the right if it's Arabic, and on the left if it's Latin)? Would be good to understand how exactly this is done. Is there any documentation of Nafitha (Google translation is possibly good enough) or some way to get access to it to try?

            Just to manage expectations, assuming I do find out how this worked it will still take me a while to implement it, as I don't have much spare time at the moment. In the meantime have you tried running it under DOSBox? It's not ideal either but it's probably able to run Nafitha as is.

            Thanks
            Rob

             
            • Rob Hagemans

              Rob Hagemans - 2016-03-02

              One other thing - If I convert SEMARE.BAS to Unicode with codepage 720 it looks strange, with the Arabic strings interspersed with superscript numbers and other strange characters. If I use codepage 864 it looks like all Arabic letters (and some numbers and some Latin text), so is that perhaps the correct codepage for this program?

              Thanks
              Rob

               
  • Anonymous

    Anonymous - 2016-03-04

    Dear Rob
    Thanks for you suggestions. I,m afraid the codepage 864 doesn't work with Arabic texts. The only one which types Arabic Alphabet is codepage 720. As far as DOSBOX is concrened, In fact I have tried it earlier but it doesn't work with this environment.

    Thank you

    Othman

     
    • Rob Hagemans

      Rob Hagemans - 2016-03-06

      Hi Othman, when you say it does not work, what is the problem you run into with codepage 864?

      I've attached two screenshots of what I see when I try it below. With codepage=720 I see mathematical symbols within the text in SEMARE.BAS:

      with codepage=864 I see only Arabic text :

      I can't see if any of these make sense at all, of course - is this text in any way correct, is it the wrong way around?

      From the page here http://www.aivosto.com/vbtips/charsets-codepages-dos.html#codepage864 I understand 864 was the only codepage supplied with MS-DOS 6.22, but Nafitha used their own encoding for which little documentation is available.

      I can try to implement some of Nafitha's functionality but I would need detailed documentation to understand what it does - at the moment I have very little to go on.

      Rob

       

      Last edit: Rob Hagemans 2016-03-06
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.