Skip to content
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
Closed

GBK Symbol Error (jruby 9.0.1.0) #3347

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

Comments

@pbl-pw
Copy link

@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 GBK Symbol Error 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
Copy link
Member

@headius 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
Copy link
Author

@pbl-pw 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
Copy link
Member

@headius 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.