Index: connectivity/source/drivers/dbase/DTable.cxx
===================================================================
RCS file: /cvs/dba/connectivity/source/drivers/dbase/DTable.cxx,v
retrieving revision 1.91
diff -u -p -u -r1.91 DTable.cxx
--- connectivity/source/drivers/dbase/DTable.cxx	16 Jan 2006 15:03:59 -0000	1.91
+++ connectivity/source/drivers/dbase/DTable.cxx	22 May 2006 11:17:42 -0000
@@ -1650,8 +1650,8 @@ BOOL ODbaseTable::UpdateBuffer(OValueRef
 
                     // convert the string, using the connection's encoding
                     ::rtl::OString sEncoded;
-                    DBTypeConversion::convertUnicodeString( sStringToWrite, sEncoded, getConnection()->getTextEncoding() );
-                    memcpy( pData, sEncoded.getStr(), ::std::min( nLen, sEncoded.getLength() ) );
+                    DBTypeConversion::convertUnicodeStringToLength( sStringToWrite, sEncoded, nLen, getConnection()->getTextEncoding() );
+                    memcpy( pData, sEncoded.getStr(), sEncoded.getLength() );
 
 				}
                 break;
Index: connectivity/source/commontools/dbtools2.cxx
===================================================================
RCS file: /cvs/dba/connectivity/source/commontools/dbtools2.cxx,v
retrieving revision 1.14
diff -u -p -u -r1.14 dbtools2.cxx
--- connectivity/source/commontools/dbtools2.cxx	2006-08-23 14:21:01.000000000 +0800
+++ connectivity/source/commontools/dbtools2.cxx	2006-08-23 16:42:12.000000000 +0800
@@ -843,6 +843,31 @@
 
         return _rDest.getLength();
     }
+
+sal_Int32 DBTypeConversion::convertUnicodeStringToLength(
+	const ::rtl::OUString& _rSource,
+	::rtl::OString&  _rDest,
+	sal_Int32 _nToLength,
+	rtl_TextEncoding _eEncoding
+)
+{
+    sal_Int32 nLen = convertUnicodeString (_rSource, _rDest, _eEncoding); 
+	if ( nLen > _nToLength ) {
+        ::rtl::OUString sExplanation( RTL_CONSTASCII_USTRINGPARAM( "The string '" ) );
+        sExplanation += _rSource;
+        sExplanation += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "' cannot be converted because it exceeds max length '" ) );
+        sExplanation += ::rtl::OUString::valueOf( _nToLength );
+        throw SQLException(
+            sExplanation,
+            NULL,
+            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "22001" ) ),
+            22001,
+            Any()
+        );
+    }
+
+	return nLen;
+}
 //.........................................................................
 }	// namespace dbtools
 //.........................................................................
Index: connectivity/inc/connectivity/dbconversion.hxx
===================================================================
RCS file: /cvs/dba/connectivity/inc/connectivity/dbconversion.hxx,v
retrieving revision 1.13
diff -u -p -u -r1.13 dbconversion.hxx
--- connectivity/inc/connectivity/dbconversion.hxx	8 Sep 2005 05:00:55 -0000	1.13
+++ connectivity/inc/connectivity/dbconversion.hxx	22 May 2006 18:47:39 -0000
@@ -197,6 +197,14 @@ namespace dbtools
             rtl_TextEncoding _eEncoding
         )
             SAL_THROW((::com::sun::star::sdbc::SQLException));
+
+        static sal_Int32 convertUnicodeStringToLength(
+            const ::rtl::OUString& _rSource,
+            ::rtl::OString&  _rDest,
+			sal_Int32 _nToLength,
+            rtl_TextEncoding _eEncoding
+		)
+            SAL_THROW((::com::sun::star::sdbc::SQLException));
 	};
 
 //.........................................................................
--- dbaccess/source/ui/dlg/detailpages.cxx	2006-08-23 14:21:12.000000000 +0800
+++ dbaccess/source/ui/dlg/detailpages.cxx	2006-08-23 14:23:38.000000000 +0800
@@ -359,43 +359,6 @@
 			if (pTypeCollection && pConnectUrl && pConnectUrl->GetValue().Len())
 				eDSType = pTypeCollection->getType(pConnectUrl->GetValue());
 
-			// the only type we're interested in is DBASE
-			if ( DST_DBASE == eDSType )
-			{
-				// for this type, we need to exclude all encodings which do not have a fixed character
-				// length (such as UTF-8)
-				rtl_TextEncodingInfo aEncodingInfo; aEncodingInfo.StructSize = sizeof( rtl_TextEncodingInfo );
-
-				OCharsetDisplay::const_iterator aLoop = _rCharSets.begin();
-				OCharsetDisplay::const_iterator aLoopEnd = _rCharSets.end();
-				while ( aLoop != aLoopEnd )
-				{
-					rtl_TextEncoding eEncoding = (*aLoop).getEncoding();
-					sal_Bool bAllowIt = sal_False;
-					if ( RTL_TEXTENCODING_DONTKNOW == eEncoding )
-						bAllowIt = sal_True;
-					else
-					{
-						// check if we should include the current encoding in the list
-						OSL_VERIFY( rtl_getTextEncodingInfo( eEncoding, &aEncodingInfo ) );
-						bAllowIt = aEncodingInfo.MinimumCharSize == aEncodingInfo.MaximumCharSize;
-					}
-
-					// get the display name for the encoding to check if we currently include it in the list
-					String sDisplayName = (*aLoop).getDisplayName();
-					const sal_Bool bHaveIt = LISTBOX_ENTRY_NOTFOUND != _pCharsets->GetEntryPos( sDisplayName );
-					if ( bAllowIt != bHaveIt )
-					{	// we need to adjust the list
-						if ( !bAllowIt )
-							_pCharsets->RemoveEntry( sDisplayName );
-						else
-							_pCharsets->InsertEntry( sDisplayName );
-					}
-
-					// next
-					++aLoop;
-				}
-			}
 		}
 	}
 	// -----------------------------------------------------------------------
