question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

daml assistant: Reading from input files fails with non-ASCII characters.

See original GitHub issue

When trying to run daml script with an input file in UTF-8 encoding that contains non-ASCII characters in a Text-typed field, it prints the following to the console and does nothing else (but doesn’t exit either):

Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1
	at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
	at java.io.BufferedReader.read1(BufferedReader.java:210)
	at java.io.BufferedReader.read(BufferedReader.java:286)
	at java.io.Reader.read(Reader.java:140)
	at scala.io.BufferedSource.mkString(BufferedSource.scala:98)
	at com.daml.lf.engine.script.RunnerMain$.$anonfun$main$3(RunnerMain.scala:71)
	at scala.Option.map(Option.scala:230)
	at com.daml.lf.engine.script.RunnerMain$.main(RunnerMain.scala:68)
	at com.daml.sdk.SdkMain$.main(SdkMain.scala:21)
	at com.daml.sdk.SdkMain.main(SdkMain.scala)

DAML version: 1.2.0-snapshot.20200527.4268.0.acc5a21c

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cocreaturecommented, Jun 15, 2020

Glad you got it working! I’ll see if we can just always default to utf-8. Reading files depending on locale is almost never useful ime.

0reactions
hyperfektcommented, Jun 15, 2020

That was it. I had selected a nonexistent locale in KDE (please don’t ask me why that is possible in the first place), so DAML fell back to the C one, which does not support UTF-8.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes — Daml SDK 2.4.2 documentation
OUT_OF_RANGE is a special case for reading past a range. Violations of the Daml ledger model always result in these kinds of errors....
Read more >
Pyyaml not reading (non-ascii) character correctly ("§")
I have the following file ( sample.
Read more >
file-20: Errors for non-ascii characters
Problem Symptoms:​​ Errors when non-ascii characters (for foreign student names/addresses) are present when attempting to load plif (p_file_20) ...
Read more >
Release of Daml SDK 1.0 - Digital Asset Blog
The new Sandbox has a known issue where some false negative contract key lookups are only correctly validated on the read path, not...
Read more >
System Event Log (SEL) - Troubleshooting Guide - Intel
Added ECC error event define for Intel® Xeon® processor scalable family. ... [3:0] – Offset from Event/Reading Code for discrete event state. Event...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found