Problem with encoding and double quotes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with encoding and double quotes

Mariano Martinez Peck
Hi! I am having a problem with encoding and I am not sure if it is a bug or if it is correct. I copy Pier and Pharo mailing list.

I am in Linux and when I write a double quote I write something like this: "Muelle Almirante Storni"

If I write in OpenOffice, when I type the double quote key, OpenOffice writes something like this:  “Muelle Almirante Storni”

Notice that the quotes are these last ones are twisted and the first were straight.


If I copy paste "Muelle Almirante Storni"  in a workspace of Pharo, it is perfectly understood. But if I paste  I get:
  ?Muelle Almirante Storni?

Now...I am developing a pier application my main problem is that my "functional information" is in .doc so they that the twisted ones. As they are put in the image trought Pier and a KomEncoded, there is not problem....until I try to search on the string. If I evaluate:

' “Muelle Almirante Storni”' findString: 'esquel' startingAt: 1 caseSensitive: false
This has a problem (index out of range) because internaly it tries to ask the asciiValue and this answers 2881 -> absurd

Now, my solution is everytime I copy paste the text from a .doc to a Pier page I have to replace those twisted quotes for the straight ones.

Is this a bug? or it is just like this ?

thanks

mariano



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with encoding and double quotes

Michael Rueger-6
2009/7/14 Mariano Martinez Peck <[hidden email]>:

The quotes you are mentioning are typographical quotes with unicode
values > 255.

> If I copy paste "Muelle Almirante Storni"  in a workspace of Pharo, it is
> perfectly understood. But if I paste  I get:
>   ?Muelle Almirante Storni?

I'm confused what works and doesn't work. Copy/paste within Pharo with
normal or typographical quotes?

> ' “Muelle Almirante Storni”' findString: 'esquel' startingAt: 1
> caseSensitive: false
> This has a problem (index out of range) because internaly it tries to ask
> the asciiValue and this answers 2881 -> absurd

> Is this a bug? or it is just like this ?

sounds like two different bugs, the paste problem (if I understood you
correctly) and the search problem.

Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with encoding and double quotes

Mariano Martinez Peck
In reply to this post by Mariano Martinez Peck


On Tue, Jul 14, 2009 at 2:39 AM, Randal L. Schwartz <[hidden email]> wrote:
>>>>> "Mariano" == Mariano Martinez Peck <[hidden email]> writes:

Mariano> If I write in OpenOffice, when I type the double quote key, OpenOffice
Mariano> writes something like this:  “Muelle Almirante Storni”

That's Windows-1252.

http://en.wikipedia.org/wiki/Windows-1252

It's not going to be interpreted properly unless everything beyond
that treats it as Windows-1252, and not ASCII or ISO-8859-1 or UTF-8,
none of which would like \223 and \224 as open and close quote.

Thanks Randal. I imagined it was some windows related encoding :(
 


--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with encoding and double quotes

Mariano Martinez Peck
In reply to this post by Michael Rueger-6


On Tue, Jul 14, 2009 at 6:07 AM, Michael Rueger <[hidden email]> wrote:
2009/7/14 Mariano Martinez Peck <[hidden email]>:

The quotes you are mentioning are typographical quotes with unicode
values > 255.

> If I copy paste "Muelle Almirante Storni"  in a workspace of Pharo, it is
> perfectly understood. But if I paste  I get:
>   ?Muelle Almirante Storni?

I'm confused what works and doesn't work. Copy/paste within Pharo with
normal or typographical quotes?

Normal work perfect. With typographical when I past it, the quotes are replaced by '?' and thus I see ?Muelle Almirante Storni?
 


> ' “Muelle Almirante Storni”' findString: 'esquel' startingAt: 1
> caseSensitive: false
> This has a problem (index out of range) because internaly it tries to ask
> the asciiValue and this answers 2881 -> absurd

> Is this a bug? or it is just like this ?

sounds like two different bugs, the paste problem (if I understood you
correctly) and the search problem.

In addition, I did this tests in Windows (the rest was Linux) and in windows works perfect all the situations with both quotes.
 


Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Problem with encoding and double quotes

Mariano Martinez Peck
Interesting....I found anothers two. Damn!  No only those typographical quotes but also this '' thing that Word puts I think when you type one '-' after another '-'. For example '--' it converts it to ''  and that is 8211 ascii.

Then when you type '...' sometimes it converts it to '…'   (they are not just 3 dots., they are smaller and nearer each other). This ascii is 8230

See here: http://www.ascii.cl/htmlcodes.htm

When you put them in a Pier page, they are properly rendered. But, when you ask the ascii to those characters in pharo, they are >255 and they are out of range compared to "matchTable"

Best,

Mariano


On Tue, Jul 14, 2009 at 9:48 AM, Mariano Martinez Peck <[hidden email]> wrote:


On Tue, Jul 14, 2009 at 6:07 AM, Michael Rueger <[hidden email]> wrote:
2009/7/14 Mariano Martinez Peck <[hidden email]>:

The quotes you are mentioning are typographical quotes with unicode
values > 255.

> If I copy paste "Muelle Almirante Storni"  in a workspace of Pharo, it is
> perfectly understood. But if I paste  I get:
>   ?Muelle Almirante Storni?

I'm confused what works and doesn't work. Copy/paste within Pharo with
normal or typographical quotes?

Normal work perfect. With typographical when I past it, the quotes are replaced by '?' and thus I see ?Muelle Almirante Storni?
 


> ' “Muelle Almirante Storni”' findString: 'esquel' startingAt: 1
> caseSensitive: false
> This has a problem (index out of range) because internaly it tries to ask
> the asciiValue and this answers 2881 -> absurd

> Is this a bug? or it is just like this ?

sounds like two different bugs, the paste problem (if I understood you
correctly) and the search problem.

In addition, I did this tests in Windows (the rest was Linux) and in windows works perfect all the situations with both quotes.
 


Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project