On Mon, Nov 06, 2006 at 03:22:11PM +0100, Henrik Grubbström wrote:
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(1) Result: "A i aa a e o."
i get:
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(3) Result: "A i A\245a A\244 e A\266."
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 127);
(4) Result: "A i Aa A e A."
(tested both 7.7.34 and 7.6.93) is it pike or my terminal?
greetings, martin.
Martin Bähr mbaehr@email.archlab.tuwien.ac.at wrote:
On Mon, Nov 06, 2006 at 03:22:11PM +0100, Henrik Grubbström wrote:
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(1) Result: "A i aa a e o."
i get:
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(3) Result: "A i A\245a A\244 e A\266."
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 127);
(4) Result: "A i Aa A e A."
(tested both 7.7.34 and 7.6.93) is it pike or my terminal?
Seems to work for me:
----8<----8<----8<----8<---- $ pike Pike v7.6 release 112 running Hilfe v3.5 (Incremental Pike Frontend)
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(1) Result: "A i aa a e o." ---->8---->8---->8---->8----
----8<----8<----8<----8<---- $ ./pike Pike v7.7 release 32 running Hilfe v3.5 (Incremental Pike Frontend)
(string)filter((array)Unicode.normalize("Å i åa ä e ö.", "DK"), `<, 256);
(1) Result: "A i aa a e o." ---->8---->8---->8---->8----
Your terminal, I'd say. Hilfe currently assumes that keyboard input is ISO-8859-1, so if you use e.g. an UTF-8 terminal, non-ascii characters will be input incorrectly.
string_to_utf8("Å i åa ä e ö."); (1) Result: "Ã\205 i Ã¥a ä e ö." (string)filter((array)Unicode.normalize(string_to_utf8("Å i åa ä e ö."), "DK"), `<, 256);
(2) Result: "A\205 i A¥a A¤ e A¶."
ok, that makes sense, as i do use an UTF-8 terminal. and using an ISO-8859-1 terminal makes it work.
hmm, i guess hilfe should pick out the locale of the terminal...
greetings, martin.
pike-devel@lists.lysator.liu.se