Dealing with accents

body { font-family: "Calibri","Slate Pro","sans-serif"; color:#262626 }

Hi!

I have an array containing a list of french verbs.
Ex : verbes =["Abaisser","Accder"]

If I print out this array on Windows Vista cmd I get as an output : ["Abaisser","Accder"] which is great.

Now if from the cmd I enter a verb to test if this verb is included in the array, it will work ok with "Abaisser" but not with "Accder" and I suppose it's because of the "".

Any idea how I could fix this ? Thanks

Ronan
Envoy de mon smartphone BlackBerry 10 sur le rseau SFR.

Hi,

in the terminal I made

verbes =[“Abaisser”,“Accder”]

and then

verbes.include?(“Accder”)

with => true

on a Mac terminal.

Is it special for Windows Vista?

Max


Von: ruby-talk [[email protected]]" im Auftrag von
"[email protected] [[email protected]]
Gesendet: Samstag, 18. Oktober 2014 10:29
An: Ruby users
Betreff: Dealing with accents

Hi!

I have an array containing a list of french verbs.
Ex : verbes =[“Abaisser”,“Accder”]

If I print out this array on Windows Vista cmd I get as an output :
[“Abaisser”,“Accder”] which is great.

Now if from the cmd I enter a verb to test if this verb is included in
the array, it will work ok with “Abaisser” but not with “Accder” and I
suppose it’s because of the “”.

Any idea how I could fix this ? Thanks

Ronan
Envoy de mon smartphone BlackBerry 10 sur le rseau SFR.

Probably an encoding problem, dont know what text editor you use but
there should be an option to save as Unicode or ms-dos, something like
that, try that for the source code file.

I should try this one.

From the command I ask user to enter a verb and then it verifies the verb is contained in the array.

Ex (on cmd) 
Enter a verb : Accder

No verb such as Accder. 

Never tried it on IRB though.

Envoy de mon smartphone BlackBerry 10 sur le rseau SFR.
De: Max H.
Envoy: samedi 18 octobre 2014 12:13
: Ruby users
Rpondre : Ruby users
Objet: AW: Dealing with accents

Hi,

in the terminal I made

verbes =["Abaisser","Accder"]


and then


verbes.include?("Accder")

 with => true


on a Mac terminal.


Is it special for Windows Vista?


Max


Von: ruby-talk [[email protected]]" im Auftrag von "[email protected] [[email protected]]
Gesendet: Samstag, 18. Oktober 2014 10:29
An: Ruby users
Betreff: Dealing with accents


Hi!

I have an array containing a list of french verbs.
Ex : verbes =["Abaisser","Accder"]

If I print out this array on Windows Vista cmd I get as an output : ["Abaisser","Accder"] which is great.

Now if from the cmd I enter a verb to test if this verb is included in the array, it will work ok with "Abaisser" but not with "Accder" and I suppose it's because of the "".

Any idea how I could fix this ? Thanks

Ronan
Envoy de mon smartphone BlackBerry 10 sur le rseau SFR.


On Oct 18, 2014, at 7:21, [email protected] wrote:

My file is UTF-8 encoded and the output in the cmd is ‎ok, if I print it out I
get what I want.

Your file is internal encoding. You’re getting input from the user or a
file. That’s external encoding.

http://nuclearsquid.com/writings/ruby-1-9-encodings/

[email protected] writes:

Now if from the cmd I enter a verb

The Windows CMD is probably the worst console around. It doesn’t do
UTF-8 by default, you have to manually issue a `chcp’ command to switch
to UTF-8, and even then the console font does not support most Unicode
characters. I’ve not used the Windows console for quite a long time, but
I do remember that dealing with anything that wasn’t ASCII was horrible.

See here for more information:

https://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how

Vale,
Quintus


Blog: http://www.quintilianus.eu

I will reject HTML emails. | Ich akzeptiere keine HTML-Nachrichten.
|
Use GnuPG for mail encryption: | GnuPG für Mail-Verschlüsselung:
http://www.gnupg.org | http://gnupg.org/index.de.html

Hi, 

I do use Simple Text 2 . My file is UTF-8 encoded and the output in the cmd is ‎ok, if I print it out I get what I want. 
No, my problem is, when I from the command ask user to enter a verb : 

Enter a verb : Abaisser 

Then I get : Abaisser is in the array

Enter a verb : Accéder

Then I get : Accéder is not in the array

Envoyé de mon smartphone BlackBerry 10 sur le réseau SFR.
De: Josh Karamuth
Envoyé: samedi 18 octobre 2014 14:47
À: Ruby users
Répondre à: Ruby users
Objet: Re: Dealing with accents

Probably an encoding problem, don’t know what text editor you use but there should be an option to save as Unicode or ms-dos, something like that, try that for the source code file.

On Oct 18, 2014, at 4:32 PM, [email protected] wrote:

I should try this one.

From the command I ask user to enter a verb and then it verifies the verb is contained in the array.

Ex (on cmd) 
Enter a verb : Accéder

No verb such as Accéder. 

Never tried it on IRB though.

Envoyé de mon smartphone BlackBerry 10 sur le réseau SFR.
De: Max Haas
Envoyé: samedi 18 octobre 2014 12:13
À: Ruby users
Répondre à: Ruby users
Objet: AW: Dealing with accents

Hi,

in the terminal I made

verbes =["Abaisser","Accéder"]


and then


verbes.include?("Accéder")

 with => true


on a Mac terminal.


Is it special for Windows Vista?


Max


Von: ruby-talk [[email protected]]" im Auftrag von "[email protected] [[email protected]]
Gesendet: Samstag, 18. Oktober 2014 10:29
An: Ruby users
Betreff: Dealing with accents


Hi!

I have an array containing a list of french verbs.
Ex : verbes =["Abaisser","Accéder"]

If I print out this array on Windows Vista cmd I get as an output : ["Abaisser","Accéder"] which is great.

Now if from the cmd I enter a verb to test if this verb is included in the array, it will work ok with "Abaisser" but not with "Accéder" and I suppose it's because of the "é".

Any idea how I could fix this ? Thanks

Ronan
Envoyé de mon smartphone BlackBerry 10 sur le réseau SFR.





Hi,

I think I got it !

In my code :

test = gets.chomp.encode!(“UTF-8”)

Then as user is invited to enter a verb, he he puts “accéder”, he will
get as an output :

Accéder is in the array.

It works fine now.

Thanks for help.

Envoyé de mon smartphone BlackBerry 10 sur le réseau SFR.
Message d’origine
De: Quintus
Envoyé: dimanche 19 octobre 2014 09:20
À: [email protected]
Répondre à: Ruby users
Objet: Re: Dealing with accents

[email protected] writes:

Now if from the cmd I enter a verb

The Windows CMD is probably the worst console around. It doesn’t do
UTF-8 by default, you have to manually issue a `chcp’ command to switch
to UTF-8, and even then the console font does not support most Unicode
characters. I’ve not used the Windows console for quite a long time, but
I do remember that dealing with anything that wasn’t ASCII was horrible.

See here for more information:

https://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how

Vale,
Quintus


Blog: http://www.quintilianus.eu

I will reject HTML emails. | Ich akzeptiere keine HTML-Nachrichten.
|
Use GnuPG for mail encryption: | GnuPG für Mail-Verschlüsselung:
http://www.gnupg.org | http://gnupg.org/index.de.html

Thanks.

I got this information once but had no need of it by the time.

I shall try.

As an example for “Accéder” in my Ruby array‎, it prints out as
“Acc\u00E9der”.

But I also get a false statement if I ask if ‎"Acc\u00E9der" is in my
array, which seems logical.

Envoyé de mon smartphone BlackBerry 10 sur le réseau SFR.
Message d’origine
De: Quintus
Envoyé: dimanche 19 octobre 2014 09:20
À: [email protected]
Répondre à: Ruby users
Objet: Re: Dealing with accents

[email protected] writes:

Now if from the cmd I enter a verb

The Windows CMD is probably the worst console around. It doesn’t do
UTF-8 by default, you have to manually issue a `chcp’ command to switch
to UTF-8, and even then the console font does not support most Unicode
characters. I’ve not used the Windows console for quite a long time, but
I do remember that dealing with anything that wasn’t ASCII was horrible.

See here for more information:

https://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how

Vale,
Quintus


Blog: http://www.quintilianus.eu

I will reject HTML emails. | Ich akzeptiere keine HTML-Nachrichten.
|
Use GnuPG for mail encryption: | GnuPG für Mail-Verschlüsselung:
http://www.gnupg.org | http://gnupg.org/index.de.html