CommandLine handler and UTF8 path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dr. Geo |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I have discovered a problem with my DrGeo command line handler. Its
purpose, under linux only for now, is to let the user open a DrGeo
sketch file from the desktop file manager by double-clicking on the file.
Sadly, it seems it does not work when non ascii characters are present
in the path or the filename.
The command line handler parameters are correctly set form the bash
script, I got this output:
drgeo --sketch=
But once in Pharo, the string representing the path to the file is
wrongly interpreted, I have this error from Pharo:
Error: /home/hilaire/
From the DrGeo.sh startup script, Pharo is fired with this instruction:
exec "$VM/pharo" \
--plugins "$VM" \
--encoding utf-8 \
-vm-display-X11 \
-title "Dr.Geo" \
$image \
$DRGEO_
Opening this same file directly form DrGeo works correctly.
Changed in drgeo: | |
status: | Triaged → Fix Committed |
Changed in drgeo: | |
milestone: | wip → 15.04 |
Changed in drgeo: | |
status: | Fix Committed → Fix Released |
The path string received by Pharo should be converted to UTF8. I thought it was already in that format, but no because Pharo internal string are not UTF-8.
To fix the issue, modify following methods:
DrGeoCommandLin eHandler> >loadScript: aString Converter: UTF8TextConverter new.
| workspace utfString |
utfString := aString convertFromWith
self checkForFile: utfString.
workspace := Workspace openFile: utfString.
workspace containingWindow fullscreen.
Compiler evaluate: workspace contents
and
DrGeoCommandLin eHandler> >loadSketch: aString Converter: UTF8TextConverter new.
| utfString |
utfString := aString convertFromWith
self checkForFile: utfString.
DrGeo fileFullscreen: utfString