[Gambas-user] gmd crashes on PostgreSQL (other 1/2 solved)

ron ronstk at ...239...
Tue Feb 17 22:58:18 CET 2004


On Tuesday 17 February 2004 20:07, Benoit Minisini wrote:
> On Monday 16 February 2004 21:19, Charlie Reinl wrote:
> > Salut,
> >
> > I added the following
> >
> > PUBLIC SUB tbvData_Data(Row AS Integer, Column AS Integer)
> >   $rData.MoveTo(Row)
> >   IF $sCharset THEN
> >     tbvData.Data.Text = Conv(Str($rData[tbvData.Columns[Column].Text]),
> > $sCharset, Desktop.Charset)
> >   ELSE
> >     tbvData.Data.Text = Str($rData[tbvData.Columns[Column].Text])
> >   ENDIF
> >   CATCH
> >     ' Convert Error
> >     IF  Error.code = 31 THEN
> >       LabelWarn.Visible=TRUE
> >       LabelWarn.Text = "Message.Error is up"
> >       Message.Error("[" & Error.code & "]  " & Error.text & gb.newline &
> > gb.newline & " try to switch off 'Use encoding (" &  $sCharset & ")'")
> >       fmain.mnuUseDatabaseEncoding_Click()
> >       LabelWarn.Text = ""
> >       LabelWarn.Visible=FALSE
> >     ENDIF
> >     Error.clear
> > END
> >
> > the following to catch the 'Unsupported String Conversation' Error.
> >
> > Amicalement
> > Charlie
> >
> > to catch the 'Unsupported String Conversation'
>
> One should check if 'SQL_ASCII' means actually 'ASCII'. If it does, then
> the gdbm could translate 'SQL_ASCII' into 'ASCII' itself, so that Conv$()
> works.

ASCII in the beginning was 7 bit, 0x00 till 0x7f or 0 /127 with the first 32 
as DeviceControlCodes, cr, lf, sot, eot,  tab and ect.
 
MS did expand this to the full 256 bytes and called this ASCII in there 
products and had the IBM graphical characters in it. ASCII extended at some 
time the first 32 could be, with a few exeptions, the foreign characters as 
ASCII-2. 
This was stable till M$ had need for more foreign cars for windows.
M$ changed the ASCII standard again and told the people it was ASCII(?).
This new set has for different languages different characters in the upper 128 
bytes and can not be sorted in a safe way.

I think SQL_ASCII is this equivalent to the ASCII-2 set else they could named 
simply ASCII. In the lower 128 bytes are i.e the French and German 
ascent/umlaut chars and are not language specific.
The Chargen ROM's for ASCII-1 and -2 stay the same for different languages.
Only the upper part was different but replaced with the codepage in windows.

------------------
I found for pg next page, it handles about the this encoding.
http://www.phphub.com/postgres_manual/index.php?p=multibyte.html

7.2.3. Automatic encoding conversion between server and client
It looks to me SQL_ASCII is a pg title.

http://www.postgresql.org/docs/7.4/interactive/functions-string.html
Table 9-8. Built-in Conversions

-------------------------
For MySQL I found
13.2.3 CREATE DATABASE Syntax

CREATE DATABASE [IF NOT EXISTS] db_name
    [create_specification [, create_specification] ...]

create_specification:
    [DEFAULT] CHARACTER SET charset_name
  | [DEFAULT] COLLATE collation_name

and a example with
  create database wickedness CHARACTER SET utf8;
Now the question for the list of charset_name's

page 5.7.1
One can specify this by putting in a MySQL option file: 
[client]
character-sets-dir=/usr/local/mysql/share/mysql/charsets

where the path points to the directory in which the dynamic MySQL character 
sets are stored. 

One can force the client to use specific character set by specifying: 
[client]
default-character-set=character-set-name

These names are not the same between postgres and mysql.





More information about the User mailing list