mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Added optional script and redef bool to enable utf-8 in ASCII logs
This commit is contained in:
parent
6927dd1213
commit
66557d3178
10 changed files with 111 additions and 2 deletions
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# @TEST-EXEC: zeek -b %INPUT
|
||||
# @TEST-EXEC: btest-diff test.log
|
||||
|
||||
@load tuning/enable-utf-8-logs
|
||||
|
||||
module Test;
|
||||
export {
|
||||
redef enum Log::ID += { LOG };
|
||||
|
||||
type Log: record {
|
||||
s: string;
|
||||
} &log;
|
||||
}
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
local a = "foo \xc2\xae bar"; # 2 bytes
|
||||
local b = "दुनिया को नमस्ते"; # Hindi characters are 3 byte utf-8
|
||||
local c = "hello 𠜎"; # A 4 byte Chinese character
|
||||
|
||||
Log::create_stream(Test::LOG, [$columns=Log]);
|
||||
Log::write(Test::LOG, [$s=a]);
|
||||
Log::write(Test::LOG, [$s=b]);
|
||||
Log::write(Test::LOG, [$s=c]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue