-
Notifications
You must be signed in to change notification settings - Fork 101
/
ex_1.rs
38 lines (28 loc) · 819 Bytes
/
ex_1.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Copyright © 2013 Free Software Foundation, Inc
See licensing in LICENSE file
File: examples/ex_1.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Simple "Hello, world" example.
*/
extern crate ncurses;
use ncurses::*;
fn main()
{
/* If your locale env is unicode, you should use `setlocale`. */
// let locale_conf = LcCategory::all;
// setlocale(locale_conf, "zh_CN.UTF-8"); // if your locale is like mine(zh_CN.UTF-8).
/* Start ncurses. */
initscr();
/* Print to the back buffer. */
addstr("Hello, world!").unwrap();
/* Print some unicode(Chinese) string. */
// addstr("Great Firewall dislike VPN protocol.\nGFW 不喜欢 VPN 协议。");
/* Update the screen. */
refresh();
/* Wait for a key press. */
getch();
/* Terminate ncurses. */
endwin();
}