Unicode Pattern

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Unicode Pattern

Postby danilomarcondes » Wed Sep 24, 2008 10:45 am

Hi,
I'm using VisualAge Smalltalk 6.0 (IBM), and I need to build a .txt file, within the Unicode pattern.
I've already used some methods to change a String to this codification, but the file still builds itself as an ANSI file.
Any sugestion would be very helpful.
Thanks.

Danilo Marcondes
Danilo Marcondes
danilomarcondes
 
Posts: 8
Joined: Wed Sep 24, 2008 10:33 am

Re: Unicode Pattern

Postby marten » Sat Sep 27, 2008 1:15 am

danilomarcondes wrote:Hi,
I'm using VisualAge Smalltalk 6.0 (IBM), and I need to build a .txt file, within the Unicode pattern.
I've already used some methods to change a String to this codification, but the file still builds itself as an ANSI file.
Any sugestion would be very helpful.
Thanks.

Danilo Marcondes


Here is an example suitable for Windows:

Code: Select all
"example how to create UTF-8 based text files"
| codePageString utfString aCfsPath aWriteStream |

aCfsPath := CfsPath named: 'd:\test-smalltalk.txt'.
aWriteStream := aCfsPath writeStreamBinary: true.

codePageString := 'I am using German umlauts: öäüÖÄÜß'.
utfString := codePageString convertToCodePage: AbtCodePageConverter utf8CodePage.

aWriteStream
  "first I write the BOM mark"
  nextPut: (Character value: 16rEF);
  nextPut: (Character value: 16rBB);
  nextPut: (Character value: 16rBF);
  "and now the text"
  nextPutAll: utfString;
  close
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: Unicode Pattern

Postby danilomarcondes » Tue Sep 30, 2008 4:00 am

Thanks, Marten!
Danilo Marcondes
danilomarcondes
 
Posts: 8
Joined: Wed Sep 24, 2008 10:33 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest