Pharo 6.1 UTF8InvalidText error

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

Pharo 6.1 UTF8InvalidText error

vikenti

Good day!
Now i download fresh latest pharo archive and unzipped it to C:\Pharo 6.1.
The error still exists.
Debugging shows that error comes with reading from environment varaible:
...
ByteString(String) convertFromWithConverter:
FilePathEncoder class decode:
WindowsResolver(platformResolver) resolveString:
WindowsResolver(platformResolver) directoryFromEnvVariableNamed:or:
...

it tries to read 'USERPROFILE', get envValue 'C:\Users\Викентий' and can't parse cyrillic characters in this path.

Please, tell me how to fix it by myself.

Best regards, Vikenti.
 



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6.1 UTF8InvalidText error

Denis Kudriashov
Hi.
Sorry for the late response. I skipped your mail somehow.

You need to try CP1251 converter. In past I used CP1251TextConverter from http://www.squeaksource.com/RussianSupport.html
But now there is very nice ZnCharacterEncoder hierarchy which provides out of the box main encodings. To get cp1251 encoder evaluate:
'cp1251' asZnCharacterEncoder
I not tried to use it in practice. So I could not give you examples for this. But I hope it gives you directions to look at.

And question for others: should not we deprecate old TextConverter's and move to zn encoders completely?

2017-11-01 7:15 GMT+01:00 Викентий Потапов <[hidden email]>:

Good day!
Now i download fresh latest pharo archive and unzipped it to C:\Pharo 6.1.
The error still exists.
Debugging shows that error comes with reading from environment varaible:
...
ByteString(String)                                      convertFromWithConverter:
FilePathEncoder class                           decode:
WindowsResolver(platformResolver) resolveString:
WindowsResolver(platformResolver) directoryFromEnvVariableNamed:or:
...

it tries to read 'USERPROFILE', get envValue 'C:\Users\Викентий' and can't parse cyrillic characters in this path.

Please, tell me how to fix it by myself.

Best regards, Vikenti.





Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6.1 UTF8InvalidText error

Sven Van Caekenberghe-2
Denis,

His problem is much more fundamental: his Pharo image does not start up (correctly) because some of its paths (his directory/folder names) where Pharo is located uses Cyrillic characters. He has no chance to fix this. I think this is a problem with FileSystem path decoding on Windows. First we needed a way to reproduce this exactly, as always.

Sven

> On 10 Nov 2017, at 11:44, Denis Kudriashov <[hidden email]> wrote:
>
> Hi.
> Sorry for the late response. I skipped your mail somehow.
>
> You need to try CP1251 converter. In past I used CP1251TextConverter from http://www.squeaksource.com/RussianSupport.html.
> But now there is very nice ZnCharacterEncoder hierarchy which provides out of the box main encodings. To get cp1251 encoder evaluate:
> 'cp1251' asZnCharacterEncoder
> I not tried to use it in practice. So I could not give you examples for this. But I hope it gives you directions to look at.
>
> And question for others: should not we deprecate old TextConverter's and move to zn encoders completely?
>
> 2017-11-01 7:15 GMT+01:00 Викентий Потапов <[hidden email]>:
>
> Good day!
> Now i download fresh latest pharo archive and unzipped it to C:\Pharo 6.1.
> The error still exists.
> Debugging shows that error comes with reading from environment varaible:
> ...
> ByteString(String)                                      convertFromWithConverter:
> FilePathEncoder class                           decode:
> WindowsResolver(platformResolver) resolveString:
> WindowsResolver(platformResolver) directoryFromEnvVariableNamed:or:
> ...
>
> it tries to read 'USERPROFILE', get envValue 'C:\Users\Викентий' and can't parse cyrillic characters in this path.
>
> Please, tell me how to fix it by myself.
>
> Best regards, Vikenti.
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6.1 UTF8InvalidText error

Denis Kudriashov
Yes, I know. 
I just described some workaround to find the fix.

So my suggestions are:
- create user with english name and run Pharo under it.
- find the place where FilePathEncoder is called and modify encoding to another one: try CP1251 instead of UTF8 or otherwise. 
- try to read your Russian folder path with fix (and without fix to ensure reproducible case)
- with found solution propose fix for Pharo or at least describe the found problem here. 

2017-11-10 12:04 GMT+01:00 Sven Van Caekenberghe <[hidden email]>:
Denis,

His problem is much more fundamental: his Pharo image does not start up (correctly) because some of its paths (his directory/folder names) where Pharo is located uses Cyrillic characters. He has no chance to fix this. I think this is a problem with FileSystem path decoding on Windows. First we needed a way to reproduce this exactly, as always.

Sven

> On 10 Nov 2017, at 11:44, Denis Kudriashov <[hidden email]> wrote:
>
> Hi.
> Sorry for the late response. I skipped your mail somehow.
>
> You need to try CP1251 converter. In past I used CP1251TextConverter from http://www.squeaksource.com/RussianSupport.html.
> But now there is very nice ZnCharacterEncoder hierarchy which provides out of the box main encodings. To get cp1251 encoder evaluate:
> 'cp1251' asZnCharacterEncoder
> I not tried to use it in practice. So I could not give you examples for this. But I hope it gives you directions to look at.
>
> And question for others: should not we deprecate old TextConverter's and move to zn encoders completely?
>
> 2017-11-01 7:15 GMT+01:00 Викентий Потапов <[hidden email]>:
>
> Good day!
> Now i download fresh latest pharo archive and unzipped it to C:\Pharo 6.1.
> The error still exists.
> Debugging shows that error comes with reading from environment varaible:
> ...
> ByteString(String)                                      convertFromWithConverter:
> FilePathEncoder class                           decode:
> WindowsResolver(platformResolver) resolveString:
> WindowsResolver(platformResolver) directoryFromEnvVariableNamed:or:
> ...
>
> it tries to read 'USERPROFILE', get envValue 'C:\Users\Викентий' and can't parse cyrillic characters in this path.
>
> Please, tell me how to fix it by myself.
>
> Best regards, Vikenti.
>
>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Pharo 6.1 UTF8InvalidText error

Denis Kudriashov
In reply to this post by Denis Kudriashov

2017-11-10 11:44 GMT+01:00 Denis Kudriashov <[hidden email]>:

And question for others: should not we deprecate old TextConverter's and move to zn encoders completely?

And I found related issue 17751.
 

2017-11-01 7:15 GMT+01:00 Викентий Потапов <[hidden email]>:

Good day!
Now i download fresh latest pharo archive and unzipped it to C:\Pharo 6.1.
The error still exists.
Debugging shows that error comes with reading from environment varaible:
...
ByteString(String)                                      convertFromWithConverter:
FilePathEncoder class                           decode:
WindowsResolver(platformResolver) resolveString:
WindowsResolver(platformResolver) directoryFromEnvVariableNamed:or:
...

it tries to read 'USERPROFILE', get envValue 'C:\Users\Викентий' and can't parse cyrillic characters in this path.

Please, tell me how to fix it by myself.

Best regards, Vikenti.