www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - error "Not the start of the UTF-8 sequence"

reply spir <denis.spir gmail.com> writes:
Hello,

I get this error message:
	Not the start of the UTF-8 sequence
without any other comment module name or whatnot.

This happens when I just added toString to the following struct, and used it:

     struct Node {
         // Note: level is equal to the number of chars up to this node.
         // Note: a 'path' node without entry has key="".
         char ch;
         uint level;
         Key key;
         Value value;
         ...
         string toString() {
             if (this.key != "")
                 return format("<%s %s:%s>", this.ch, this.key, this.value);
             else
                 return format("<%s>", this.ch);
         }
     }

Hints? I'm blocked :-(

Denis
-- 
_________________
vita es estrany
spir.wikidot.com
Apr 06 2011
parent reply Kagamin <spam here.lot> writes:
spir Wrote:

 Hello,
 
 I get this error message:
 	Not the start of the UTF-8 sequence
 without any other comment module name or whatnot.
 
 This happens when I just added toString to the following struct, and used it:
 
      struct Node {
          // Note: level is equal to the number of chars up to this node.
          // Note: a 'path' node without entry has key="".
          char ch;
          uint level;
          Key key;
          Value value;
          ...
          string toString() {
              if (this.key != "")
                  return format("<%s %s:%s>", this.ch, this.key, this.value);
              else
                  return format("<%s>", this.ch);
          }
      }
 
 Hints? I'm blocked :-(
 
 Denis
 -- 
 _________________
 vita es estrany
 spir.wikidot.com
 
struct Node { // Note: level is equal to the number of chars up to this node. // Note: a 'path' node without entry has key="". dchar ch;
Apr 06 2011
parent reply spir <denis.spir gmail.com> writes:
On 04/06/2011 11:53 AM, Kagamin wrote:
 spir Wrote:

 Hello,

 I get this error message:
 	Not the start of the UTF-8 sequence
 without any other comment module name or whatnot.

 This happens when I just added toString to the following struct, and used it:

       struct Node {
           // Note: level is equal to the number of chars up to this node.
           // Note: a 'path' node without entry has key="".
           char ch;
           uint level;
           Key key;
           Value value;
           ...
           string toString() {
               if (this.key != "")
                   return format("<%s %s:%s>", this.ch, this.key, this.value);
               else
                   return format("<%s>", this.ch);
           }
       }

 Hints? I'm blocked :-(
       struct Node {
           // Note: level is equal to the number of chars up to this node.
           // Note: a 'path' node without entry has key="".
           dchar ch;
Sorry, no, nothing to do with the type. The error came from a special case where ch='\0'. Seems some routine in dmd does not like that; but no idea where the error comes from. There are two points to solve, I guess: * The error message should tell where it happens. * '\0' is a valid code point, should pass through without error. Denis -- _________________ vita es estrany spir.wikidot.com
Apr 06 2011
parent Kagamin <spam here.lot> writes:
spir Wrote:

 I get this error message:
 	Not the start of the UTF-8 sequence
if it's '\0', the error message is clearly incorrect, report a bug.
Apr 07 2011