ΕΕΛ/ΛΑΚ - Λίστες Ταχυδρομείου

Re: OpenOffice.org patch για ελληνικά & PostgreSQL 8.0 Announcement

  • Subject: Re: OpenOffice.org patch για ελληνικά & PostgreSQL 8.0 Announcement
  • From: Alexios Zavras <zvr [ at ] pobox [ dot ] com>
  • Date: Fri, 14 Jan 2005 13:05:49 +0200
Michalis Kabrianis wrote [edited]:
> Όπως ίσως ξέρετε όσοι ασχολείστε με το openoffice.org υπάρχει (μεταξύ 
> άλλων) ένα πρόβλημα με το export των ελληνικών χαρακτήρων σε html.
[...]
> Επειδή η επαναφορά του θα μας πάρει αρκετό χρόνο, θέλουμε να ζητήσουμε 
> αν κάποιος από εδώ έχει κάποιο δέντρο από το οποίο να χτίζει το 
> openoffice.org (οποιαδήποτε έκδοση) να δοκιμάσει να φτιάξει το patch 
> σύντομα και να το στείλει, για να μη χάσουμε την ευκαιρία να ενσωματωθεί 
> στην έκδοση 2.0 του OpenOffice.org

Attached.
Den eixa dentro, alla ena wget toy source, ena tar zxvf,
ki ena vim argotera (argh! tabstops ana 4!?!),
to patch einai etoimo.  [eisai tyxeros poy eixa disko adeio]
An thelei kai kaneis allos na to dokimasei... :-)

Mia poy milas esy me aytoys, steil'to toys kalytera esy
(mexri na brw pws kai poy na to kanw egw...)
-- 
-- zvr --
--  +---------------------------+       Alexios Zavras (-zvr-)
    | H eytyxia den exei enoxes |       zvr [ at ] pobox [ dot ] com
    +-----------------------zvr-+
--- OOo_1.1.4rc_source/svtools/source/svhtml/htmlout.cxx	2002-03-13 10:42:08.000000000 +0200
+++ OOo_1.1.4rc-zvr/svtools/source/svhtml/htmlout.cxx	2005-01-14 12:30:00.000000000 +0200
@@ -98,7 +98,7 @@
 const sal_Char __FAR_DATA HTMLOutFuncs::sNewLine[] = "\015\012";
 #endif
 
-const sal_Char *lcl_svhtml_GetEntityForChar( sal_Unicode c )
+const sal_Char *lcl_svhtml_GetEntityForChar( sal_Unicode c, rtl_TextEncoding eDestEnc )
 {
 	const sal_Char* pStr = 0;
 	switch( c )
@@ -216,58 +216,11 @@
 	case 402:		pStr = sHTML_S_fnof;	break;
 	case 710:		pStr = sHTML_S_circ;	break;
 	case 732:		pStr = sHTML_S_tilde;	break;
-	case 913:		pStr = sHTML_S_Alpha;	break;
-	case 914:		pStr = sHTML_S_Beta;	break;
-	case 915:		pStr = sHTML_S_Gamma;	break;
-	case 916:		pStr = sHTML_S_Delta;	break;
-	case 917:		pStr = sHTML_S_Epsilon;	break;
-	case 918:		pStr = sHTML_S_Zeta;	break;
-	case 919:		pStr = sHTML_S_Eta;		break;
-	case 920:		pStr = sHTML_S_Theta;	break;
-	case 921:		pStr = sHTML_S_Iota;	break;
-	case 922:		pStr = sHTML_S_Kappa;	break;
-	case 923:		pStr = sHTML_S_Lambda;	break;
-	case 924:		pStr = sHTML_S_Mu;		break;
-	case 925:		pStr = sHTML_S_Nu;		break;
-	case 926:		pStr = sHTML_S_Xi;		break;
-	case 927:		pStr = sHTML_S_Omicron;	break;
-	case 928:		pStr = sHTML_S_Pi;		break;
-	case 929:		pStr = sHTML_S_Rho;		break;
-	case 931:		pStr = sHTML_S_Sigma;	break;
-	case 932:		pStr = sHTML_S_Tau;		break;
-	case 933:		pStr = sHTML_S_Upsilon;	break;
-	case 934:		pStr = sHTML_S_Phi;		break;
-	case 935:		pStr = sHTML_S_Chi;		break;
-	case 936:		pStr = sHTML_S_Psi;		break;
-	case 937:		pStr = sHTML_S_Omega;	break;
-	case 945:		pStr = sHTML_S_alpha;	break;
-	case 946:		pStr = sHTML_S_beta;	break;
-	case 947:		pStr = sHTML_S_gamma;	break;
-	case 948:		pStr = sHTML_S_delta;	break;
-	case 949:		pStr = sHTML_S_epsilon;	break;
-	case 950:		pStr = sHTML_S_zeta;	break;
-	case 951:		pStr = sHTML_S_eta;		break;
-	case 952:		pStr = sHTML_S_theta;	break;
-	case 953:		pStr = sHTML_S_iota;	break;
-	case 954:		pStr = sHTML_S_kappa;	break;
-	case 955:		pStr = sHTML_S_lambda;	break;
-	case 956:		pStr = sHTML_S_mu;		break;
-	case 957:		pStr = sHTML_S_nu;		break;
-	case 958:		pStr = sHTML_S_xi;		break;
-	case 959:		pStr = sHTML_S_omicron;	break;
-	case 960:		pStr = sHTML_S_pi;		break;
-	case 961:		pStr = sHTML_S_rho;		break;
-	case 962:		pStr = sHTML_S_sigmaf;	break;
-	case 963:		pStr = sHTML_S_sigma;	break;
-	case 964:		pStr = sHTML_S_tau;		break;
-	case 965:		pStr = sHTML_S_upsilon;	break;
-	case 966:		pStr = sHTML_S_phi;		break;
-	case 967:		pStr = sHTML_S_chi;		break;
-	case 968:		pStr = sHTML_S_psi;		break;
-	case 969:		pStr = sHTML_S_omega;	break;
-	case 977:		pStr = sHTML_S_thetasym;break;
-	case 978:		pStr = sHTML_S_upsih;	break;
-	case 982:		pStr = sHTML_S_piv;		break;
+
+	// Greek chars are handled later,
+	// since they should *not* be transformed to entities
+	// when generating Greek text (== using Greek encoding)
+
 	case 8194:		pStr = sHTML_S_ensp;	break;
 	case 8195:		pStr = sHTML_S_emsp;	break;
 	case 8201:		pStr = sHTML_S_thinsp;	break;
@@ -362,6 +315,68 @@
 	case 9830:		pStr = sHTML_S_diams;	break;
 	}
 
+	// Greek chars: if we do not produce a Greek encoding,
+	// transform them into entities
+	if( ( eDestEnc != RTL_TEXTENCODING_ISO_8859_7 ) &&
+	    ( eDestEnc != RTL_TEXTENCODING_MS_1253 ) )
+	{
+		switch( c )
+		{
+		case 913:	pStr = sHTML_S_Alpha;	break;
+		case 914:	pStr = sHTML_S_Beta;	break;
+		case 915:	pStr = sHTML_S_Gamma;	break;
+		case 916:	pStr = sHTML_S_Delta;	break;
+		case 917:	pStr = sHTML_S_Epsilon;	break;
+		case 918:	pStr = sHTML_S_Zeta;	break;
+		case 919:	pStr = sHTML_S_Eta;		break;
+		case 920:	pStr = sHTML_S_Theta;	break;
+		case 921:	pStr = sHTML_S_Iota;	break;
+		case 922:	pStr = sHTML_S_Kappa;	break;
+		case 923:	pStr = sHTML_S_Lambda;	break;
+		case 924:	pStr = sHTML_S_Mu;		break;
+		case 925:	pStr = sHTML_S_Nu;		break;
+		case 926:	pStr = sHTML_S_Xi;		break;
+		case 927:	pStr = sHTML_S_Omicron;	break;
+		case 928:	pStr = sHTML_S_Pi;		break;
+		case 929:	pStr = sHTML_S_Rho;		break;
+		case 931:	pStr = sHTML_S_Sigma;	break;
+		case 932:	pStr = sHTML_S_Tau;		break;
+		case 933:	pStr = sHTML_S_Upsilon;	break;
+		case 934:	pStr = sHTML_S_Phi;		break;
+		case 935:	pStr = sHTML_S_Chi;		break;
+		case 936:	pStr = sHTML_S_Psi;		break;
+		case 937:	pStr = sHTML_S_Omega;	break;
+		case 945:	pStr = sHTML_S_alpha;	break;
+		case 946:	pStr = sHTML_S_beta;	break;
+		case 947:	pStr = sHTML_S_gamma;	break;
+		case 948:	pStr = sHTML_S_delta;	break;
+		case 949:	pStr = sHTML_S_epsilon;	break;
+		case 950:	pStr = sHTML_S_zeta;	break;
+		case 951:	pStr = sHTML_S_eta;		break;
+		case 952:	pStr = sHTML_S_theta;	break;
+		case 953:	pStr = sHTML_S_iota;	break;
+		case 954:	pStr = sHTML_S_kappa;	break;
+		case 955:	pStr = sHTML_S_lambda;	break;
+		case 956:	pStr = sHTML_S_mu;		break;
+		case 957:	pStr = sHTML_S_nu;		break;
+		case 958:	pStr = sHTML_S_xi;		break;
+		case 959:	pStr = sHTML_S_omicron;	break;
+		case 960:	pStr = sHTML_S_pi;		break;
+		case 961:	pStr = sHTML_S_rho;		break;
+		case 962:	pStr = sHTML_S_sigmaf;	break;
+		case 963:	pStr = sHTML_S_sigma;	break;
+		case 964:	pStr = sHTML_S_tau;		break;
+		case 965:	pStr = sHTML_S_upsilon;	break;
+		case 966:	pStr = sHTML_S_phi;		break;
+		case 967:	pStr = sHTML_S_chi;		break;
+		case 968:	pStr = sHTML_S_psi;		break;
+		case 969:	pStr = sHTML_S_omega;	break;
+		case 977:	pStr = sHTML_S_thetasym;break;
+		case 978:	pStr = sHTML_S_upsih;	break;
+		case 982:	pStr = sHTML_S_piv;		break;
+		}
+	}
+
 	return pStr;
 }
 
@@ -389,7 +404,7 @@
 		// because Netscape 4 does support UTF-8 but does not support
 		// these entities.
 		if( c < 256 || RTL_TEXTENCODING_UTF8 != eDestEnc )
-			pStr = lcl_svhtml_GetEntityForChar( c );
+			pStr = lcl_svhtml_GetEntityForChar( c, eDestEnc );
 		break;
 	}
 

πλοήγηση μηνυμάτων