require 'hpricot'
require 'hpricot/xchar'
Hpricot::XChar::PREDEFINED_U.merge!({" " => 32})←①
or
Hpricot::XChar::PREDEFINED_U.update({" " => 32})←②
doc = Hpricot('before after
')
puts doc.inner_text
①または②を記載する。
「 」へのエンコード対応表がないので原因。投稿を公開
Hpricot::XChar::PREDEFINED_U.merge!({" " => 32})←①
or
Hpricot::XChar::PREDEFINED_U.update({" " => 32})←②
doc = Hpricot('before after
')
puts doc.inner_text
①または②を記載する。
「 」へのエンコード対応表がないので原因。投稿を公開
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Iterator;
import org.apache.cayenne.CayenneException;
import org.apache.cayenne.access.Transaction;
public class NoTransaction extends Transaction {
@Override
public void begin() {
}
@Override
public void commit() throws IllegalStateException, SQLException, CayenneException {
close();
}
@Override
public void rollback() throws IllegalStateException, SQLException, CayenneException {
close();
}
protected void close() {
if (connections == null || connections.isEmpty()) {
return;
}
Iterator it = connections.values().iterator();
while (it.hasNext()) {
try {
((Connection) it.next()).close();
}
catch (Throwable th) {
}
}
}
}
Transaction tx = new NoTransaction();
try {
Transaction.bindThreadTransaction(tx);
Expression expression = ExpressionFactory.matchExp(~);
SelectQuery query = new SelectQuery(Ent.class, expression);
ListentList = getDataContext().performQuery(query);
if (CollectionUtils.isEmpty(entList))
return null;
return entList;
}
finally {
try {
tx.commit();
} catch (Exception e) {
}
}
if (Prototype.Browser.IE6)
alert('You are using IE6');
else if (Prototype.Browser.IE)
alert('You are using IE7');
else
alert('Not IE');