Skip to content

Commit

Permalink
- changed technique to ensure UTF-8 string in ruby (bnc#848812)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Nov 4, 2013
1 parent c38b802 commit a24d6f9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions package/yast2-storage.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Nov 04 16:42:35 CET 2013 - aschnell@suse.de

- changed technique to ensure UTF-8 string in ruby (bnc#848812)

-------------------------------------------------------------------
Wed Oct 30 17:44:29 CET 2013 - aschnell@suse.de

Expand Down
2 changes: 1 addition & 1 deletion src/modules/FileSystems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#
#
# $Id$
require "storage_utf8"
require "storage"
require "yast"

module Yast
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Partitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Purpose: Provides information about partitions
#
# $Id$
require "storage_utf8"
require "storage"
require "yast"

module Yast
Expand Down
20 changes: 10 additions & 10 deletions src/modules/Storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# $Id$
require "yast"
require "dbus"
require "storage_utf8"
require "storage"

module Yast
class StorageClass < Module
Expand Down Expand Up @@ -390,22 +390,22 @@ def ClassicStringToByte(str)


def ByteToHumanString(bytes)
::Storage::byteToHumanString(bytes, false, 2, false)
return ::Storage::byteToHumanString(bytes, false, 2, false).force_encoding("UTF-8")
end


def KByteToHumanString(bytes_k)
::Storage::byteToHumanString(bytes_k*1024, false, 2, false)
return ::Storage::byteToHumanString(bytes_k*1024, false, 2, false).force_encoding("UTF-8")
end


def ByteToHumanStringOmitZeroes(bytes)
::Storage::byteToHumanString(bytes, false, 2, true)
return ::Storage::byteToHumanString(bytes, false, 2, true).force_encoding("UTF-8")
end


def KByteToHumanStringOmitZeroes(bytes_k)
::Storage::byteToHumanString(bytes_k*1024, false, 2, true)
return ::Storage::byteToHumanString(bytes_k*1024, false, 2, true).force_encoding("UTF-8")
end


Expand Down Expand Up @@ -5272,7 +5272,7 @@ def GetCommitInfos
infos.each do |info|
m = {
:destructive => info.destructive,
:text => info.text
:text => info.text.force_encoding("UTF-8")
}
ret.push(m)
end
Expand Down Expand Up @@ -5308,15 +5308,15 @@ def ChangeText


def LastAction
ret = @sint.getLastAction()
ret
return @sint.getLastAction().force_encoding("UTF-8")
end


def ExtendedErrorMsg
ret = @sint.getExtendedErrorMessage()
ret
return @sint.getExtendedErrorMessage().force_encoding("UTF-8")
end


def SetZeroNewPartitions(val)
Builtins.y2milestone("SetZeroNewPartitions val:%1", val)
@sint.setZeroNewPartitions(val)
Expand Down
4 changes: 2 additions & 2 deletions src/modules/StorageClients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#
# Purpose: Define callbacks for libstorage.
require "yast"
require "storage_utf8"
require "storage"


module Yast
Expand Down Expand Up @@ -143,7 +143,7 @@ def CommitErrorPopup(error, last_action, extended_message)
)

Builtins.y2milestone("before getErrorString error:%1", error )
tmp = @sint.getErrorString(error)
tmp = @sint.getErrorString(error).force_encoding("UTF-8")
Builtins.y2milestone("before getErrorString ret:%1", tmp )
text = Ops.add(Ops.add(text, tmp), "\n\n") if !Builtins.isempty(tmp)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/StorageInit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Authors: Thomas Fehr (fehr@suse.de)
#
# Purpose: Helper module to initialize libstorage
require "storage_utf8"
require "storage"
require "yast"

module Yast
Expand Down

0 comments on commit a24d6f9

Please sign in to comment.