Re: [Vala] printf bug with nonlatin pattern



done

http://bugzilla.gnome.org/show_bug.cgi?id=547236

Jared Moore пишет:
Hi,

Please file a bug for this in bugzilla [1], since it will get
lost/forgotten in the mailing list.

[1] http://bugzilla.gnome.org/enter_bug.cgi?product=vala

Cheers,
Jared

2008/8/11 Alexey Lubimov <avl l14 ru>:
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;
 }

}

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]