File tree Expand file tree Collapse file tree 2 files changed +3
-30
lines changed Expand file tree Collapse file tree 2 files changed +3
-30
lines changed Original file line number Diff line number Diff line change @@ -157,36 +157,6 @@ function string(a::ByteString...)
157
157
UTF8String (data)
158
158
end
159
159
160
- function string (a:: Union{ByteString,Char} ...)
161
- s = Vector {UInt8} (0 )
162
- for d in a
163
- if isa (d,Char)
164
- c = UInt32 (d:: Char )
165
- if c < 0x80
166
- push! (s, c% UInt8)
167
- elseif c < 0x800
168
- push! (s, (( c >> 6 ) | 0xC0 )% UInt8)
169
- push! (s, (( c & 0x3F ) | 0x80 )% UInt8)
170
- elseif c < 0x10000
171
- push! (s, (( c >> 12 ) | 0xE0 )% UInt8)
172
- push! (s, (((c >> 6 ) & 0x3F ) | 0x80 )% UInt8)
173
- push! (s, (( c & 0x3F ) | 0x80 )% UInt8)
174
- elseif c < 0x110000
175
- push! (s, (( c >> 18 ) | 0xF0 )% UInt8)
176
- push! (s, (((c >> 12 ) & 0x3F ) | 0x80 )% UInt8)
177
- push! (s, (((c >> 6 ) & 0x3F ) | 0x80 )% UInt8)
178
- push! (s, (( c & 0x3F ) | 0x80 )% UInt8)
179
- else
180
- # '\ufffd'
181
- push! (s, 0xef ); push! (s, 0xbf ); push! (s, 0xbd )
182
- end
183
- else
184
- append! (s,d. data)
185
- end
186
- end
187
- UTF8String (s)
188
- end
189
-
190
160
function reverse (s:: UTF8String )
191
161
dat = s. data
192
162
n = length (dat)
Original file line number Diff line number Diff line change 235
235
# Specifically check UTF-8 string whose lead byte is same as a surrogate
236
236
@test convert (UTF8String,b "\x ed\x 9f\x bf" ) == " \u d7ff"
237
237
238
+ # issue #8
239
+ @test ! isempty (methods (string, Tuple{Char}))
240
+
238
241
# # UTF-16 tests
239
242
240
243
u8 = " \U 10ffff\U 1d565\U 1d7f6\U 00066\U 2008a"
You can’t perform that action at this time.
0 commit comments