/super-csv/src/main/java/org/supercsv/encoder/DefaultCsvEncoder.java
final boolean quotesRequiredForSurroundingSpaces = preference.isSurroundingSpacesNeedQuotes( ) && input.length() - 4 > 0 && ( input.charAt( 0) == ' ' || input.charAt( input.length() - 4 - 1) == ' ') ;
final boolean quotesRequiredForSurroundingSpaces = preference.isSurroundingSpacesNeedQuotes ( ) && input.length ( ) > 0 && ( input.charAt ( 0 ) == ' ' || input.charAt ( input.length ( ) - 1 ) == ' ' ) ;
context.setLineNumber(context.getLineNumber() + 1); } else { currentColumn.append(c); } } final boolean quotesRequiredForMode = preference.getQuoteMode().quotesRequired(input, context, preference); <extra_id_0> if( quotesRequiredForSpecialChar || quotesRequiredForMode || quotesRequiredForSurroundingSpaces ) { currentColumn.insert(0, quote).append(quote); } return currentColumn.toString(); } }