Skip to content

Commit

Permalink
Reverse incorrect conversion order in these methods - document with t…
Browse files Browse the repository at this point in the history
…est.
  • Loading branch information
Henrik Sperre Johansen committed May 18, 2020
1 parent a153e04 commit 6919f43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Multilingual-Tests/ByteTextConverterTest.class.st
Expand Up @@ -32,6 +32,16 @@ ByteTextConverterTest >> testLatin2ToUnicodeConversion [
self assert: (unicodeString at: 4) charCode equals: (utfCodePoints at: 4)
]

{ #category : #testing }
ByteTextConverterTest >> testMacRomanToUnicodeShorthand [
| macRomanCharacter unicodeCharacter |
macRomanCharacter := Character value: 16r80.
unicodeCharacter := $Ä.

self assert: macRomanCharacter macRomanToUnicode equals: unicodeCharacter.
self assert: macRomanCharacter equals: unicodeCharacter unicodeToMacRoman.
]

{ #category : #testing }
ByteTextConverterTest >> testUnicodeToLatin2Conversion [
| latin2Bytes internalString encodingStream encodedBytes |
Expand Down
4 changes: 2 additions & 2 deletions src/Multilingual-TextConversion/Character.extension.st
Expand Up @@ -4,12 +4,12 @@ Extension { #name : #Character }
Character >> macRomanToUnicode [
"Convert the receiver from MacRoman Unicode."

^MacRomanTextConverter new unicodeToByte: self
^MacRomanTextConverter new byteToUnicode: self
]

{ #category : #'*Multilingual-TextConversion' }
Character >> unicodeToMacRoman [
"Convert the receiver from Unicode to MacRoman encoding."

^MacRomanTextConverter new byteToUnicode: self
^MacRomanTextConverter new unicodeToByte: self
]

0 comments on commit 6919f43

Please sign in to comment.