Accents on printf

classic Classic list List threaded Threaded
4 messages Options
Osvaldo Carvalho Osvaldo Carvalho
Reply | Threaded
Open this post in threaded view
|

Accents on printf

Hello,

When I execute a program from Scipad with a printf with a format string with accents, conversion codes after the first accent are ignored. For instance, a program with the code

n = 5;
printf("\n%d! est égal à %d",n,factorial(n))
printf("\n%d! est egal à %d",n,factorial(n))
printf("\n%d! est egal a %d",n,factorial(n))

produces

5! est égal à %d
5! est egal à %d
5! est egal a 120

while, from the console, the same statement produces a correct output::

-->printf("\n%d! est égal à %d",n,factorial(n))

5! est égal à 120

Are there any restrictions on the use of accents on printf?

Thanks,

Osvaldo

Francois Vogel-2 Francois Vogel-2
Reply | Threaded
Open this post in threaded view
|

Re: Accents on printf

Osvaldo Sergio Farhat de Carvalho said on 29/09/2009 20:44:
>
> When I execute a program from Scipad with a printf with a format string
> with accents, conversion codes after the first accent are ignored.

This is not a Scipad bug. It is a Scilab 5 bug.

Proof: put your code:

> n = 5;
> printf("\n%d! est égal à %d",n,factorial(n))

in a file printfbug.sce and then from Scilab:

-->exec "printfbug.sce";

5! est égal à %d
-->

> Are there any restrictions on the use of accents on printf?

Well, you have just found a regression in Scilab 5 that does not
happen with Scicoslab.

Francois

Osvaldo Carvalho Osvaldo Carvalho
Reply | Threaded
Open this post in threaded view
|

Re: Accents on printf - and also on input

Thanks, François.

By the way, there is also a (perhaps related) bug with the input statement. The statement:

s = input("s = ","string")

shows the following behaviour on Scilab when you type a string with special characters:

s = François
s =

Fran

If you try this you will also note that the leading blanks on "s = " only appear after you press Enter.

I hope the development team will fix these bugs soon. In Brazil, as in France, we need to deal with special characters all the time.

Osvaldo




Ocultação de detalhes inativa deFrançois Vogel ---29/09/2009 19:55:26---Osvaldo Sergio Farhat de Carvalho said on 29/09/2009 20François Vogel ---29/09/2009 19:55:26---Osvaldo Sergio Farhat de Carvalho said on 29/09/2009 20:44:


De:

François Vogel <[hidden email]>

Para:

[hidden email]

Data:

29/09/2009 19:55

Assunto:

Re: [scilab-Users] Accents on printf




Osvaldo Sergio Farhat de Carvalho said on 29/09/2009 20:44:
>
> When I execute a program from Scipad with a printf with a format string
> with accents, conversion codes after the first accent are ignored.

This is not a Scipad bug. It is a Scilab 5 bug.

Proof: put your code:

> n = 5;
> printf("\n%d! est égal à %d",n,factorial(n))

in a file printfbug.sce and then from Scilab:

-->exec "printfbug.sce";

5! est égal à %d
-->

> Are there any restrictions on the use of accents on printf?

Well, you have just found a regression in Scilab 5 that does not
happen with Scicoslab.

Francois


sylvestre sylvestre
Reply | Threaded
Open this post in threaded view
|

Re: Accents on printf - and also on input

Le mardi 29 septembre 2009 à 21:07 -0300, Osvaldo Sergio Farhat de
Carvalho a écrit :

> Thanks, François.
>
> By the way, there is also a (perhaps related) bug with the input
> statement. The statement:
>
> s = input("s = ","string")
>
> shows the following behaviour on Scilab when you type a string with
> special characters:
>
> s = François
> s =
>
> Fran
>
> If you try this you will also note that the leading blanks on "s = "
> only appear after you press Enter.
>
> I hope the development team will fix these bugs soon. In Brazil, as in
> France, we need to deal with special characters all the time.
For the "first bug", I am not able to reproduce it under Linux both for
the master branch or the 5.1.1.
For the one you just reported, this bug, among many other UTF-8-related
issues, has been fixed in the current master.

Sylvestre

--
-------------------------
Sylvestre Ledru
-------------------------
The Scilab Consortium
Digiteo
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex
France