New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBK Symbol Error (jruby 9.0.1.0) #3347

Closed
pbl-pw opened this Issue Sep 24, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@pbl-pw

pbl-pw commented Sep 24, 2015

GBK encoding source file with GBK symbol like

#encoding : GBK

puts :测试

reports error "Invalid char...", but

#encoding : GBK

puts :'测试'

is ok.
However,same file run in MRI is ok.

@pbl-pw pbl-pw changed the title from GBK Symbol Error to GBK Symbol Error (jruby 9.0.1.0) Sep 24, 2015

@rtyler rtyler added the JRuby 9000 label Sep 26, 2015

@headius headius added this to the JRuby 9.1.9.0 milestone Apr 27, 2017

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Apr 27, 2017

Member

This appears to be working mostly ok now. My console does not appear to render the puts output correctly but there's no error.

Member

headius commented Apr 27, 2017

This appears to be working mostly ok now. My console does not appear to render the puts output correctly but there's no error.

@headius headius closed this Apr 27, 2017

@pbl-pw

This comment has been minimized.

Show comment
Hide comment
@pbl-pw

pbl-pw Apr 29, 2017

great! It's works now!
But still has bug for exsample:

# encoding : GBK
# frozen_string_literal: true

class CTT
	def 测试
		puts "#{__callee__} : first"
	end
	define_method(:测试){
		puts "#{__callee__} : second"
	}
end

obj = CTT.new
obj.测试
obj.send :测试

jruby 9.1.9.0-SNAPSHOT (2.3.3) 2017-04-28 ee137a8 Java HotSpot(TM) Client VM 25.131-b11 on 1.8.0_131-b11 +jit [mswin32-x86] output:

?? : first
测试 : second

MRI output:

测试 : second
测试 : second

pbl-pw commented Apr 29, 2017

great! It's works now!
But still has bug for exsample:

# encoding : GBK
# frozen_string_literal: true

class CTT
	def 测试
		puts "#{__callee__} : first"
	end
	define_method(:测试){
		puts "#{__callee__} : second"
	}
end

obj = CTT.new
obj.测试
obj.send :测试

jruby 9.1.9.0-SNAPSHOT (2.3.3) 2017-04-28 ee137a8 Java HotSpot(TM) Client VM 25.131-b11 on 1.8.0_131-b11 +jit [mswin32-x86] output:

?? : first
测试 : second

MRI output:

测试 : second
测试 : second
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Apr 29, 2017

Member

@Personnel This is the other half of encoding work that @enebo is working on: making all identifiers use proper encoding too. In this case, it will need to get translated into the JIT naming of the compiled method as well as being properly represented in the method table.

Can you open a new bug for that, please?

Member

headius commented Apr 29, 2017

@Personnel This is the other half of encoding work that @enebo is working on: making all identifiers use proper encoding too. In this case, it will need to get translated into the JIT naming of the compiled method as well as being properly represented in the method table.

Can you open a new bug for that, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment