public static void announceForAccessibility(Context context, String message) {
AccessibilityManager manager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (manager.isEnabled()) {
AccessibilityEvent e = AccessibilityEvent.obtain();
e.setEventType(AccessibilityEvent.TYPE_ANNOUNCEMENT);
e.setClassName(context.getClass().getName());
e.setPackageName(context.getPackageName());
e.getText().add(message);
manager.sendAccessibilityEvent(e);
}
}
pdo set names utf8< - 我该怎么做
答案 0 :(得分:-1)
试试这个:
$options = [
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
];
$this->connection = new PDO(
'mysql:host=localhost:3307;dbname=project',
'root',
'usbw',
$options
);
$this->connection->setAttribute(
PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION
);