[Vala] printf bug with nonlatin pattern
- From: Alexey Lubimov <avl l14 ru>
- To: vala-list gnome org
- Subject: [Vala] printf bug with nonlatin pattern
- Date: Mon, 11 Aug 2008 03:46:30 +0400
printf don't accept nonlatin string as pattern:
for example:
stdout.printf("Успешно %s", "прошел");
or
"Успешно %s".printf("прошел");
but sucessfully accept predefined string!
for example:
string pattern = "Успешно %s";
pattern.printf("прошел");
testcase attached;
valac -o string_bug string_bug.vala
string_bug.vala:11.5-11.41: error: Too many arguments for specified format
stdout.printf("Успешно %s", "прошел");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
But with workaround:
valac -o string_bug string_bug.vala
./string_bug
Успешно прошел
//valac -o string_bug string_bug.vala
public class StringBug : GLib.Object
{
public static int main (string[] args) {
// this is case to reproduce bug in valac
// stdout.printf("УÑпеÑно %s", "пÑоÑел");
// this is workaround
string pattern = "УÑпеÑно %s";
stdout.printf(pattern,"пÑоÑел");
return 0;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]