Re: [xml-dev] [off-topic] xtext -- encoding declarations for text

From
Richard Tobin <>
To
Date
2003-05-20T10:21:19Z
ID
<>
Thread
Re: [xml-dev] [off-topic] xtext -- encoding declarations for text
>> Also, the fact that the first few characters depend on the application
>> will make it hard to write general transcoders.

>I had thought that too, but on thinking about it more I cannot see any 
>additional complexity compared with the XML Appendix F.  The details 
>of the algorithm are different but still it is the same three steps

[...]

> * else look for EBCDIC/ASCII signature (use string "[^a-zA-Z01-9]{1-4}xtext\b" 
>    rather than "<?xml\b"

For XML, it's only necessary to look at the first four bytes to cover
Unicode encodings, ascii supersets and ebcdic.  In the xtext case, you
will have to compare a string at several different positions or apply
a regular expression.  Certainly doable, but certainly more complex too!

-- Richard