Re: Database encoding

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Jean-Michel POURE'" <jm(dot)poure(at)freesurf(dot)fr>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Database encoding
Date: 2001-09-23 07:25:23
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00AFD@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr]
> Sent: 23 September 2001 08:10
> To: pgadmin-hackers(at)postgresql(dot)org
> Subject: Re: [pgadmin-hackers] Database encoding
>
>
>
> >Encoding can be a string or an integer. To be honest, I never use
> >encoding so I know virtually nothing about it at all. If you
> think it's
> >being done incorrectly, let me know and I'll fix it as you suggest.
> >
> >Later, Dave.
>
> Hello,
>
> If possible, I would prefer the display of stings vs numbers.
> In psql, \list returns the list of databases with encoding names
> (ex:'SQL_ASCII').

OK, I'll look at that. I think there has been work on the server to do with
this recently - I'll look back at the list archives.

/D

> In my case, this helps distinguish between SQL_ASCII and
> UNICODE encoding. I would suggest declaring Private
> szEncoding As String in pgSchema.
>
> Later/JMP
>
> **************************************************************
> **************
> **************************
> Public Function EncodingIntegerToString (iEncoding As
> Integer) As String On Error GoTo Err_Handler
>
> Select Case iEncoding
> Case 0
> EncodingIntegerToString = "SQL_ASCII"
>
> Case 1
> EncodingIntegerToString = "EUC_JP"
>
> Case 2
> EncodingIntegerToString = "EUC_CN"
>
> Case 3
> EncodingIntegerToString = "EUC_KR"
>
> Case 4
> EncodingIntegerToString = "EUC_TW"
>
> Case 5
> EncodingIntegerToString = "UNICODE"
>
> Case 6
> EncodingIntegerToString = "MULE_INTERNAL"
>
> Case 7
> EncodingIntegerToString = "LATIN1"
>
> Case 8
> EncodingIntegerToString = "LATIN2"
>
> Case 9
> EncodingIntegerToString = "LATIN3"
>
> Case 10
> EncodingIntegerToString = "LATIN4"
>
> Case 11
> EncodingIntegerToString = "LATIN5"
>
> Else
> EncodingIntegerToString = CStr(iEncoding)
> End Select
>
> Exit Function
> Err_Handler: objServer.iLogError Err
> End Function
>
> Public Function EncodingStringToInteger(szEncoding As String)
> As Integer On Error GoTo Err_Handler
>
> Select Case szEncoding
> Case "SQL_ASCII"
> EncodingStringToInteger = 0
>
> Case "EUC_JP"
> EncodingStringToInteger = 1
>
> Case "EUC_CN"
> EncodingStringToInteger = 2
>
> Case "EUC_KR"
> EncodingStringToInteger = 3
>
> Case "EUC_TW"
> EncodingStringToInteger = 4
>
> Case "UNICODE"
> EncodingStringToInteger = 5
>
> Case "MULE_INTERNAL"
> EncodingStringToInteger = 6
>
> Case "LATIN1"
> EncodingStringToInteger = 7
>
> Case "LATIN2"
> EncodingStringToInteger = 8
>
> Case "LATIN3"
> EncodingStringToInteger = 9
>
> Case "LATIN4"
> EncodingStringToInteger = 10
>
> Case "LATIN5"
> EncodingStringToInteger = 11
>
> Else
> EncodingStringToInteger = CInt(szEncoding)
> End Select
>
> Exit Function
> Err_Handler: objServer.iLogError Err
> End Function
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>

Browse pgadmin-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-09-23 08:45:33 Encoding holes
Previous Message Jean-Michel POURE 2001-09-23 07:10:10 Re: Database encoding