SQLite - 尝试使用包含带有特殊字符的文本的SQL读取文件会导致奇怪的符号

时间:2015-09-10 22:33:21

标签: sqlite

我正在尝试创建一个可用于生成带有一组数据的数据库的SQL脚本,但是一旦我尝试在SQLite中读取脚本,特殊字符(特别是带有波浪号的n)就变得人类无法读取。以下是带有问题的脚本示例:

1|se├▒or

运行查询“SELECT * FROM person;”返回以下结果:

var today = new Date();
var day = today.getDay();
var daylist = ["Sunday","Monday","Tuesday","Wednesday ","Thursday","Friday","Saturday"];

console.log("Today is : " + daylist[day] + ".");
var hour = today.getHours(); 
var minute = today.getMinutes();
var second = today.getSeconds();
var prepand = (hour >= 12) ? " PM " : " AM ";

// Convert from 24-hour time to 12-hour time
hour = (hour >= 12) ? hour - 12 : hour;

if (hour === 0 && minute === 0 && second === 0) {
  // It is either midnight or noon on a 12 hour clock
  // Both midnight and noon on a 12-hour clock is 12:00:00
  hour = 12;

  if(prepand === ' PM ') {
      // It is 12:00:00 on a 12-hour and a 24-hour clock
      prepand = ' Noon';
  } else { // prepand = AM
      // It is 12:00:00 on a 12-hour clock and 00:00:00 on a 24-hour clock
      prepand = ' Midnight';
  }
}

我的课程要求我能够在sqlite命令行应用程序中显示特殊符号。如果我将insert命令复制并粘贴到sqlite控制台,那么该值将正确显示。

0 个答案:

没有答案