Open damonkohler opened 9 years ago
From @GoogleCodeExporter on May 31, 2015 11:23
I have switched to beanshell since I can't see how this would work in perl with
utf8
not available in the installation.
I saw the same problem, but with following naive patch I can produce files with
utf8
encoding from a .bsh script:
e.g.
PrintWriter out = new PrintWriter(new OutputStreamWriter(timelog, "UTF-8"),
true);
--- e:\ase\extras\bsh\android.bsh.orig 2009-09-27 13:29:24.000000000 +0200
+++ e:\ase\extras\bsh\android.bsh 2009-09-27 23:17:50.000000000 +0200
@@ -18,11 +18,11 @@
String AP_PORT = System.getenv().get("AP_PORT");
Socket conn = new Socket("127.0.0.1", Integer.decode(AP_PORT));
BufferedReader in = new BufferedReader(
- new InputStreamReader(conn.getInputStream(), "8859_1"));
+ new InputStreamReader(conn.getInputStream(), "UTF-8"));
OutputStream out_stream = new BufferedOutputStream(
conn.getOutputStream());
PrintWriter out = new PrintWriter(
- new OutputStreamWriter(out_stream, "8859_1"), true);
+ new OutputStreamWriter(out_stream, "UTF-8"), true);
int id = 0;
call(String method, JSONArray params) {
Original comment by adrian.a...@gmail.com
on 1 Oct 2009 at 7:05
From @GoogleCodeExporter on May 31, 2015 11:23
Original comment by damonkoh...@gmail.com
on 1 Oct 2009 at 7:16
From @GoogleCodeExporter on May 31, 2015 11:23
I added utf8 to the list of modules-to-package, so whenever Damon cuts a new
release it should be there
(http://code.google.com/p/android-scripting/source/detail?
r=65eff52aff3a0bd7ac064156d5061c2592b744a9)
However, I feel that I have to point out that the utf8 module is very rarely
the thing ou want for "utf8" or
"Unicode". Please read "perluniintro" if this doesn't sound familiar. (As
with the beanshell code above, it's
usually more of a question of doing Unicode I/O.
I'm transferring this ticket back to Damon for the bsh fix.
Original comment by jhietaniemi
on 7 Oct 2009 at 10:32
From @GoogleCodeExporter on May 31, 2015 11:23
Original comment by jhietaniemi
on 7 Oct 2009 at 10:33
From @GoogleCodeExporter on May 31, 2015 11:23
Original comment by jhietaniemi
on 7 Oct 2009 at 10:35
From @GoogleCodeExporter on May 31, 2015 11:23
In Python you need to keep in mind to declare your encoding.
# -*- coding: utf-8 -*-
Otherwise it crashes when you encounter foreign characters.
print('über cool')
SyntaxError: Non-ASCII character '\xc3' in file ...
Original comment by pdietz84
on 2 Dec 2009 at 5:09
From @GoogleCodeExporter on May 31, 2015 11:23
Is there any news on getting a fix for Perl sorted anytime soon? JSON/PP.pm
makes
*heavy* use of various encode/decode UTF8 routines. As JSON is a main route for
traffic between Perl, ASE, and the Android stack, it's quite a big deal that
there's
no utf8 support yet.
I'll happily look into fixing this issue if no one else is currently...
Original comment by alexel...@gmail.com
on 27 May 2010 at 9:56
From @GoogleCodeExporter on May 31, 2015 11:23
Hi alexelder,
Sawyer would probably be interested in any help you're will to provide.
Original comment by damonkoh...@gmail.com
on 28 May 2010 at 7:19
From @GoogleCodeExporter on May 31, 2015 11:23
If the only thing missing is utf8.pm, that shouldn't be a problem at all.
I've added an assert script for this on my perl-android-scripts github repo.
Original comment by xsawy...@gmail.com
on 28 May 2010 at 10:10
From @GoogleCodeExporter on May 31, 2015 11:23
Original issue reported on code.google.com by
adrian.a...@gmail.com
on 26 Sep 2009 at 8:17Copied from original issue: damonkohler/android-scripting#108