Discussion:
Accessing directories with a german "umlaut" in the name
chuchuchu747
2013-06-01 09:57:09 UTC
Permalink
Hi All,

when I try to access a folder with a german "umlaut" in the folder name I get an exception:

Rolfs Kinderfr├╝hling

Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfr├╝hling
---------
items Directory.io 48
Directory directories umlautTest.io 3
CLI doFile Z_CLI.io 140
CLI run IoState_runCLI() 1

The exception occurs when I try to get the subdirectories:
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs Kinderfrühling")
dir name println
childs := dir directories

The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?

With best regards,
Chris
Jeremy Tregunna
2013-06-01 18:19:05 UTC
Permalink
That sounds to me like a codepage/encoding issue. If you are using UTF-8 you should have no problem, anything else, and all bets are off. For instance; I run

$ mkdir ÃŒber
$ mkdir ÃŒber/foo

Then in io, this code:

Io> Directory directories map(name)
==> list(ÃŒber)
Io> Directory directories at(0) items map(name)
==> list(., ..)

The above is just a simplification of your code, I can also run your code:

Io> dir := Directory clone setPath("/Users/jtregunna/ÃŒber")
==> Directory_0x7fc7e98a58e0:

Io> dir name println
ÃŒber
==> ÃŒber

Io> childs := dir directories map(name)
==> list(foo)

Regards,

Jeremy Tregunna
Post by chuchuchu747
Hi All,
Rolfs Kinderfr├╝hling
Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfr├╝hling
---------
items Directory.io (http://Directory.io) 48
Directory directories umlautTest.io (http://umlautTest.io) 3
CLI doFile Z_CLI.io (http://Z_CLI.io) 140
CLI run IoState_runCLI() 1
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs KinderfrÃŒhling")
dir name println
childs := dir directories
The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?
With best regards,
Chris
chuchuchu747
2013-06-01 19:16:15 UTC
Permalink
Hi Jeremy,

do you know how I can check (or change) which codepage is used by IO? In the shell self everything works fine. I can create folders with ü and ö and can access them.
I have tried "chcp 65001" with no luck. One thing to mention, I have installed a german windows and changed the UI langauge to english.

With best regards,
Chris
Post by Jeremy Tregunna
That sounds to me like a codepage/encoding issue. If you are using UTF-8 you should have no problem, anything else, and all bets are off. For instance; I run
$ mkdir ÃŒber
$ mkdir ÃŒber/foo
Io> Directory directories map(name)
==> list(ÃŒber)
Io> Directory directories at(0) items map(name)
==> list(., ..)
Io> dir := Directory clone setPath("/Users/jtregunna/ÃŒber")
Io> dir name println
ÃŒber
==> ÃŒber
Io> childs := dir directories map(name)
==> list(foo)
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi All,
Rolfs Kinderfrâ"œâ•hling
Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfrâ"œâ•hling
---------
items Directory.io (http://Directory.io) 48
Directory directories umlautTest.io (http://umlautTest.io) 3
CLI doFile Z_CLI.io (http://Z_CLI.io) 140
CLI run IoState_runCLI() 1
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs KinderfrÃŒhling")
dir name println
childs := dir directories
The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?
With best regards,
Chris
Jeremy Tregunna
2013-06-01 19:20:47 UTC
Permalink
No, sorry.

Regards,

Jeremy Tregunna
Post by chuchuchu747
Hi Jeremy,
do you know how I can check (or change) which codepage is used by IO? In the shell self everything works fine. I can create folders with Ì and ö and can access them.
I have tried "chcp 65001" with no luck. One thing to mention, I have installed a german windows and changed the UI langauge to english.
With best regards,
Chris
Post by Jeremy Tregunna
That sounds to me like a codepage/encoding issue. If you are using UTF-8 you should have no problem, anything else, and all bets are off. For instance; I run
$ mkdir Ìber
$ mkdir Ìber/foo
Io> Directory directories map(name)
==> list(Ìber)
Io> Directory directories at(0) items map(name)
==> list(., ..)
Io> dir := Directory clone setPath("/Users/jtregunna/Ìber")
Io> dir name println
Ìber
==> Ìber
Io> childs := dir directories map(name)
==> list(foo)
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi All,
Rolfs Kinderfrâ"œâ•hling
Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfrâ"œâ•hling
---------
items Directory.io (http://Directory.io) (http://Directory.io) 48
Directory directories umlautTest.io (http://umlautTest.io) (http://umlautTest.io) 3
CLI doFile Z_CLI.io (http://Z_CLI.io) (http://Z_CLI.io) 140
CLI run IoState_runCLI() 1
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs KinderfrÌhling")
dir name println
childs := dir directories
The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?
With best regards,
Chris
chuchuchu747
2013-06-11 14:40:35 UTC
Permalink
Could someone please try this on windows?
I think this is a problem with the windows binaries.
Post by Jeremy Tregunna
No, sorry.
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi Jeremy,
do you know how I can check (or change) which codepage is used by IO? In the shell self everything works fine. I can create folders with Ì and ö and can access them.
I have tried "chcp 65001" with no luck. One thing to mention, I have installed a german windows and changed the UI langauge to english.
With best regards,
Chris
Post by Jeremy Tregunna
That sounds to me like a codepage/encoding issue. If you are using UTF-8 you should have no problem, anything else, and all bets are off. For instance; I run
$ mkdir Ìber
$ mkdir Ìber/foo
Io> Directory directories map(name)
==> list(Ìber)
Io> Directory directories at(0) items map(name)
==> list(., ..)
Io> dir := Directory clone setPath("/Users/jtregunna/Ìber")
Io> dir name println
Ìber
==> Ìber
Io> childs := dir directories map(name)
==> list(foo)
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi All,
Rolfs Kinderfrâ"œâ•hling
Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfrâ"œâ•hling
---------
items Directory.io (http://Directory.io) (http://Directory.io) 48
Directory directories umlautTest.io (http://umlautTest.io) (http://umlautTest.io) 3
CLI doFile Z_CLI.io (http://Z_CLI.io) (http://Z_CLI.io) 140
CLI run IoState_runCLI() 1
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs KinderfrÌhling")
dir name println
childs := dir directories
The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?
With best regards,
Chris
Kevin Edwards
2013-06-13 05:41:39 UTC
Permalink
I took a look and the Io .c code doesn't appear to do any codepage
conversions. Io just expects UTF-8 to and from Win32 ANSI API
calls, while that API expects and provides strings in the ANSI
system code page encoding which can't be set to UTF-8.

For proper Unicode support on Windows, Io should use the Wide
version (UTF-16LE) of the Win32 API and convert back and forth
between MultiByte and WideChar.

Sorry, this is not an easy fix.

Kevin
Post by chuchuchu747
Could someone please try this on windows?
I think this is a problem with the windows binaries.
Post by Jeremy Tregunna
No, sorry.
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi Jeremy,
do you know how I can check (or change) which codepage is used by IO? In the shell self everything works fine. I can create folders with Ì and ö and can access them.
I have tried "chcp 65001" with no luck. One thing to mention, I have installed a german windows and changed the UI langauge to english.
With best regards,
Chris
Post by Jeremy Tregunna
That sounds to me like a codepage/encoding issue. If you are using UTF-8 you should have no problem, anything else, and all bets are off. For instance; I run
$ mkdir ÃfÂŒber
$ mkdir ÃfÂŒber/foo
Io> Directory directories map(name)
==> list(ÃfÂŒber)
Io> Directory directories at(0) items map(name)
==> list(., ..)
Io> dir := Directory clone setPath("/Users/jtregunna/ÃfÂŒber")
Io> dir name println
ÃfÂŒber
==> ÃfÂŒber
Io> childs := dir directories map(name)
==> list(foo)
Regards,
Jeremy Tregunna
Post by chuchuchu747
Hi All,
Rolfs Kinderfrâ"ÂoeâÂ.Â?hling
Exception: Unable to open directory Y:\Shared Music\Kinderlieder\Rolfs Kinderfrâ"ÂoeâÂ.Â?hling
---------
items Directory.io (http://Directory.io) (http://Directory.io) 48
Directory directories umlautTest.io (http://umlautTest.io) (http://umlautTest.io) 3
CLI doFile Z_CLI.io (http://Z_CLI.io) (http://Z_CLI.io) 140
CLI run IoState_runCLI() 1
dir := Directory clone setPath("Y:\\Shared Music\\Kinderlieder\\Rolfs KinderfrÃfÂŒhling")
dir name println
childs := dir directories
The folder has no subdirecotries but that shouldn't raise an exception right?
I'm running Windows 8 on a german latop but the system language is english.
Does anyone has an idea?
With best regards,
Chris
------------------------------------
Yahoo! Groups Links
Loading...