[Cuis] (Minimal) requirements for Unicode support?

Juan Vuletich juan at jvuletich.org
Wed Feb 20 18:43:38 CST 2013


Hi Hannes,

On 2/13/2013 2:46 PM, H. Hirzel wrote:
> Hello Juan
>
>> On 2/8/13, Juan Vuletich<juan at jvuletich.org>  wrote:
>>> Unfortunately, this means I broke the examples at
>>> https://github.com/hhzl/Cuis-Add-Ons/blob/master/UnicodeNotes.md .
> I have updated the file UnicodeNotes.md

Thanks. Just a small correction. You say "Note: #utf8ToISO8859s15 is 
only used by the clipboard.", but that's no longer true, as now 
#fromUtf8: is used.

> and I did a test class (attached) which shows how to read and write an
> UTF8 file.
>
> test5ReadWriteUtf8
> 	
> 	"see UnicodeNotes.md"
> 	
>       "self new test5ReadWriteUtf8"
>       | stream content byteArray byteArray2 |
>
> 	"read UTF8 Unicode file into internal string with NCRs"
> 	"for NCR see http://en.wikipedia.org/wiki/Numeric_character_reference"
> 	
> 	stream := (FileStream  fileNamed:  self class fileName) binary.
> 	byteArray := stream contentsOfEntireFile.
>        content := String fromUtf8: byteArray.
> 	"NCRs were added to 'content' as needed"
>
> 	"write internal string back to UTF8 file with NCRs converted back to
> UTF8 chars"
> 	stream := (FileStream  forceNewFileNamed:  self class fileName2) binary.
> 	stream nextPutAll: (content asUtf8: true).  "true means: convert NCRs
> back to UTF8"
> 	stream close.
>
>        "compare the two versions: what is in file 'fileName' with what
> is in file 'fileName2'"
> 	stream := (FileStream  fileNamed:  self class fileName) binary.
> 	byteArray := stream contentsOfEntireFile.
> 	stream close.
>
> 	stream := (FileStream  fileNamed:  self class fileName2) binary.
> 	byteArray2 := stream contentsOfEntireFile.
> 	stream close.
>
> 	self assert: byteArray = byteArray2.
>
>
> BTW according to http://en.wikipedia.org/wiki/UTF8 'Official name and variants'
> UTF8 should all be uppercase.
>
> As of now I can use Cuis 4.1-1590 as is for my work which includes
> reading and writing UTF8 encoded text files (including HTML files). So
> as far as I am concerned further extended Cuis Unicode support might
> be put on the back burner for some time.
>
> However it might still be worthwhile considering maintaining a
> TextConverter and UTF8Converter class for compatibility and other
> reasons. More on this later.
>
> Thank you for the update
>
> https://github.com/jvuletich/Cuis/blob/master/UpdatesSinceLastRelease/1590-InvertibleUTF8Conversion-JuanVuletich-2013Feb08-08h11m-jmv.1.cs.st
>
> and
>
> kind regards
>
> Hannes Hirzel
>
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20130220/2e4e8236/attachment-0002.html>


More information about the Cuis mailing list