Menu

#3 i18n bugs

open
nobody
None
5
2005-08-28
2005-08-28
Anonymous
No

Russian, scandinavian and some special characters are
not encoded correctly. Which makes the Java+Spring
hessian service throw an exception "unknown code:" when
I'm using HessianRuby to communicate with it.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Iconv fixes the problem with writeStringData. I haven't
    found a solution for deserialize yet.

    def writeStringData(o)
    writeLength(o.length)
    o = Iconv::iconv( "UTF-8", "ISO-8859-1", o )[0]
    puts o
    @s += o
    end

     
  • Nobody/Anonymous

    Logged In: NO

    This code was snatched from the PHP version of hessian and
    it seems to fix the deserialize part of the bug:

    def readNextString(length)
    count = 0
    val = ""

    length.times do
    char = @input[@offset..@offset]

    @offset += 1
    charCode = char[0];
    if(charCode < 0x80)
    val = val + char
    elsif((charCode & 0xe0) == 0xc0)
    val = val + char + @input[@offset..@offset]
    @offset += 1
    elsif ((charCode & 0xf0) == 0xe0)
    val = val + char + @input[@offset..@offset+1]
    @offset += 2
    else
    raise "Bad utf-8 encoding"
    end
    end

    val
    end

    The writeStringData fixed the serialization part.

     
  • Nobody/Anonymous

    Logged In: NO

    Here's a test case that shows this problem:

    require 'hessianProxy'
    test =
    Hessian::HessianProxy.new("http://www.caucho.com/hessian/test/basic")
    test.echo("Itrntinliztin")

    The output is:
    Invalid tag, expected 'r', received '<'

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.