vb.net - .Net Windows Form Arabic Encoding issue at Runtime -
i created vb.net windows forms project under vs2008 , windows vista, when take code other pc having vs2015 , windows 10 faced encoding problem, application has arabic captions in it, visual studio able read captions when click start (f5) compile , run app see arabic text not encoded. knowing when took compiled version of app old pc , run in new pc behave expected , arabic texts displayed well, problem here on compile time of vs2015 under windows 10.
i searched around issue advises try open files code editor , use compatible encoding, don't have problem reading code content, problem when compiling code not encode arabic text.
the following code of frmwelcome.designer.vb
<global.microsoft.visualbasic.compilerservices.designergenerated()> _ partial class frmwelcome inherits system.windows.forms.form 'form overrides dispose clean component list. <system.diagnostics.debuggernonusercode()> _ protected overrides sub dispose(byval disposing boolean) if disposing andalso components isnot nothing components.dispose() end if mybase.dispose(disposing) end sub 'required windows form designer private components system.componentmodel.icontainer 'note: following procedure required windows form designer 'it can modified using windows form designer. 'do not modify using code editor. <system.diagnostics.debuggerstepthrough()> _ private sub initializecomponent() dim resources system.componentmodel.componentresourcemanager = new system.componentmodel.componentresourcemanager(gettype(frmwelcome)) me.btnsalescenter = new system.windows.forms.button me.btnadministrator = new system.windows.forms.button me.btnpurchasecenter = new system.windows.forms.button me.picturebox1 = new system.windows.forms.picturebox me.btnminimize = new system.windows.forms.picturebox me.label5 = new system.windows.forms.label me.btnclose = new system.windows.forms.picturebox me.label3 = new system.windows.forms.label ctype(me.picturebox1, system.componentmodel.isupportinitialize).begininit() ctype(me.btnminimize, system.componentmodel.isupportinitialize).begininit() ctype(me.btnclose, system.componentmodel.isupportinitialize).begininit() me.suspendlayout() ' 'btnsalescenter ' me.btnsalescenter.flatstyle = system.windows.forms.flatstyle.flat me.btnsalescenter.font = new system.drawing.font("times new roman", 20.25!, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ctype(0, byte)) me.btnsalescenter.forecolor = system.drawing.color.navy me.btnsalescenter.location = new system.drawing.point(408, 276) me.btnsalescenter.name = "btnsalescenter" me.btnsalescenter.size = new system.drawing.size(262, 70) me.btnsalescenter.tabindex = 1 me.btnsalescenter.tabstop = false me.btnsalescenter.text = "قسم المبيعات" me.btnsalescenter.usevisualstylebackcolor = true ' 'btnadministrator ' me.btnadministrator.backcolor = system.drawing.color.white me.btnadministrator.flatstyle = system.windows.forms.flatstyle.flat me.btnadministrator.font = new system.drawing.font("times new roman", 20.25!, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ctype(0, byte)) me.btnadministrator.forecolor = system.drawing.color.navy me.btnadministrator.location = new system.drawing.point(408, 200) me.btnadministrator.name = "btnadministrator" me.btnadministrator.size = new system.drawing.size(262, 70) me.btnadministrator.tabindex = 0 me.btnadministrator.tabstop = false me.btnadministrator.text = "الادارة" me.btnadministrator.usevisualstylebackcolor = false ' 'btnpurchasecenter ' me.btnpurchasecenter.flatstyle = system.windows.forms.flatstyle.flat me.btnpurchasecenter.font = new system.drawing.font("times new roman", 20.25!, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ctype(0, byte)) me.btnpurchasecenter.forecolor = system.drawing.color.navy me.btnpurchasecenter.location = new system.drawing.point(408, 352) me.btnpurchasecenter.name = "btnpurchasecenter" me.btnpurchasecenter.size = new system.drawing.size(262, 70) me.btnpurchasecenter.tabindex = 21 me.btnpurchasecenter.tabstop = false me.btnpurchasecenter.tag = "" me.btnpurchasecenter.text = "قسم المشتريات" me.btnpurchasecenter.usevisualstylebackcolor = true ' 'picturebox1 ' me.picturebox1.cursor = system.windows.forms.cursors.hand me.picturebox1.image = ctype(resources.getobject("picturebox1.image"), system.drawing.image) me.picturebox1.location = new system.drawing.point(78, 240) me.picturebox1.name = "picturebox1" me.picturebox1.size = new system.drawing.size(146, 138) me.picturebox1.sizemode = system.windows.forms.pictureboxsizemode.centerimage me.picturebox1.tabindex = 151 me.picturebox1.tabstop = false ' 'btnminimize ' me.btnminimize.backcolor = system.drawing.color.navy me.btnminimize.cursor = system.windows.forms.cursors.hand me.btnminimize.image = ctype(resources.getobject("btnminimize.image"), system.drawing.image) me.btnminimize.location = new system.drawing.point(676, 5) me.btnminimize.name = "btnminimize" me.btnminimize.size = new system.drawing.size(50, 50) me.btnminimize.sizemode = system.windows.forms.pictureboxsizemode.zoom me.btnminimize.tabindex = 231 me.btnminimize.tabstop = false ' 'label5 ' me.label5.autosize = true me.label5.backcolor = system.drawing.color.navy me.label5.font = new system.drawing.font("times new roman", 27.75!, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ctype(0, byte)) me.label5.forecolor = system.drawing.color.white me.label5.location = new system.drawing.point(464, 9) me.label5.name = "label5" me.label5.size = new system.drawing.size(206, 42) me.label5.tabindex = 230 me.label5.text = "القائمة الرئيسية" ' 'btnclose ' me.btnclose.backcolor = system.drawing.color.navy me.btnclose.cursor = system.windows.forms.cursors.hand me.btnclose.image = ctype(resources.getobject("btnclose.image"), system.drawing.image) me.btnclose.location = new system.drawing.point(732, 5) me.btnclose.name = "btnclose" me.btnclose.size = new system.drawing.size(50, 50) me.btnclose.sizemode = system.windows.forms.pictureboxsizemode.zoom me.btnclose.tabindex = 229 me.btnclose.tabstop = false ' 'label3 ' me.label3.backcolor = system.drawing.color.navy me.label3.font = new system.drawing.font("times new roman", 27.75!, system.drawing.fontstyle.regular, system.drawing.graphicsunit.point, ctype(0, byte)) me.label3.forecolor = system.drawing.color.navy me.label3.location = new system.drawing.point(0, -3) me.label3.name = "label3" me.label3.size = new system.drawing.size(800, 67) me.label3.tabindex = 228 ' 'frmwelcome ' me.autoscaledimensions = new system.drawing.sizef(6.0!, 13.0!) me.autoscalemode = system.windows.forms.autoscalemode.font me.backcolor = system.drawing.color.white me.clientsize = new system.drawing.size(794, 568) me.controlbox = false me.controls.add(me.btnminimize) me.controls.add(me.label5) me.controls.add(me.btnclose) me.controls.add(me.label3) me.controls.add(me.picturebox1) me.controls.add(me.btnpurchasecenter) me.controls.add(me.btnsalescenter) me.controls.add(me.btnadministrator) me.formborderstyle = system.windows.forms.formborderstyle.fixedsingle me.maximizebox = false me.name = "frmwelcome" me.startposition = system.windows.forms.formstartposition.centerscreen me.text = "القائمة الرئيسية" ctype(me.picturebox1, system.componentmodel.isupportinitialize).endinit() ctype(me.btnminimize, system.componentmodel.isupportinitialize).endinit() ctype(me.btnclose, system.componentmodel.isupportinitialize).endinit() me.resumelayout(false) me.performlayout() end sub friend withevents btnadministrator system.windows.forms.button friend withevents btnsalescenter system.windows.forms.button friend withevents btnpurchasecenter system.windows.forms.button friend withevents picturebox1 system.windows.forms.picturebox friend withevents btnminimize system.windows.forms.picturebox friend withevents label5 system.windows.forms.label friend withevents btnclose system.windows.forms.picturebox friend withevents label3 system.windows.forms.label end class
this expected screen:
and screen after compile:
please advise.
i managed solve problem, took me lot of time finish it.
the solution following:
- open each file containing arabic visual basic editor encoding , choose arabic windows codepage 1256.
- click on save , in save screen choose arrow on save button select save encoding , select utc-8.
it replace old file new 1 format, after finished files build solution , run , worked expected. (more 70 files , each of them 1 design , other code 140 files)
i hope experience problem can faced same issue.
Comments
Post a Comment