BBC BASIC for Windows
Programming >> BBC BASIC language >> Turkish Character Unicode Problem
http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1311009905

Turkish Character Unicode Problem
Post by ae34tr on Jul 18th, 2011, 5:25pm

Hi I got sent but not able to run the program we are making a mistake onuda could not find the program you are interested I'd appreciate being sent greetings

Thenk You
----------------------------------------------------

vdu 23,22,720;480;8,16,16,128+8 : rem Select UTF-8 mode

*PRINTERFONT Courier,24
*MARGINS 10,10,10,10

vdu 2,21 : rem Enable printer, disable screen

turkish$ = "Başlılara baş eğdirmiş, dizlilere diz çöktürmüş."

print turkish$

print "Test ***** Test"

vdu 12,6,3 : rem Eject sheet, enable screen, disable printer

print "Test ***** Test"


Ahmet Eksioglu
ae34tr@hotmail.com
Re: Turkish Character Unicode Problem
Post by admin on Jul 18th, 2011, 7:21pm

on Jul 18th, 2011, 5:25pm, ae34tr wrote:
could not find the program

UNICODEP.BBC is supplied with BBC BASIC for Windows. It can be found in the EXAMPLES\GENERAL subfolder of the installation directory. If it is missing, download and install the latest version of BB4W (5.93a) and it will be replaced.

Remember that you must use UTF-8 text in BBC BASIC, not UTF-16. So instead of:

Code:
      print "Test ***** Test" 

you should have:

Code:
      VDU 23,22,720;480;8,16,16,128+8 : REM Select UTF-8 mode
      
      *FONT Courier New,20
      
      PRINT "Test ÐÐÐÐÐ*ÝÝÝÝÝ*ÞÞÞÞÞ*ððððð*ýýýýý*þþþþþ Test"
 

The text will not look correct in the editor, but it will print OK when you run the program.

Richard.
Re: Turkish Character Unicode Problem
Post by admin on Jul 18th, 2011, 7:35pm

on Jul 18th, 2011, 7:21pm, Richard Russell wrote:
The text will not look correct in the editor, but it will print OK when you run the program.

Here is a hint for seeing the correct text in the program:

  1. Save the program as a BASIC Text File (*.BAS)
  2. Run MS NOTEPAD
  3. Open the .BAS file with the Encoding set to UTF-8
The program will then be shown with the correct Unicode text strings, and can be printed.

Richard.