SQLite Forum

.mode box does not seem to like UTF-8
Login
Running the following test

Create Table Tracks (id,text);
Insert Into Tracks Values( 1,'夜明~朝ごはんの歌 Yoake ~ Asa-Gohan No Uta (Sunrise - The Breakfast Song)');
Insert Into Tracks Values( 2,'朝の通学路 Asa No Tsūgakuji (Off To School In The Morning)');
Insert Into Tracks Values( 3,'馬鹿騒ぎ Bakasawagi (A Big Commotion)');
Insert Into Tracks Values( 4,'追憶 Tsuioku (Reminiscence)');
.mode box
.once unibox.txt
Select id,
       Length(text) As Characters,
       Length(Cast(text As BLOB)) As Bytes,
       text 
  From Tracks Order By id;

I get this output:

┌────┬────────────┬───────┬───────────────────────────────────────────────────────────────────┐
│ id │ Characters │ Bytes │                               text                                │
├────┼────────────┼───────┼───────────────────────────────────────────────────────────────────┤
│ 1  │ 65         │ 81    │ 夜明~朝ごはんの歌 Yoake ~ Asa-Gohan No Uta (Sunrise - The Breakfast Song) │
│ 2  │ 53         │ 64    │ 朝の通学路 Asa No Tsūgakuji (Off To School In The Morning)             │
│ 3  │ 33         │ 41    │ 馬鹿騒ぎ Bakasawagi (A Big Commotion)                                 │
│ 4  │ 25         │ 29    │ 追憶 Tsuioku (Reminiscence)                                         │
└────┴────────────┴───────┴───────────────────────────────────────────────────────────────────┘

It appears .mode box gets confused about the length of the text column.