Convert string into code symbols by pl/sql - oracle
I have to convert string in my local language into UTF code symbols (I suppose it is UTF code simbols) using pl/sql.
For example the initial string is: "шт", the target string should be шт
Is there any ideas how to that.
Thank you.
Conversion of all Win-1251 symbols to UTF:
Lengthy, but does not depend on server codepage :-)
S := REPLACE(S,'Ђ','Ђ');
S := REPLACE(S,'Ѓ','Ѓ');
S := REPLACE(S,'‚','‚');
S := REPLACE(S,'ѓ','ѓ');
S := REPLACE(S,'„','„');
S := REPLACE(S,'…','…');
S := REPLACE(S,'†','†');
S := REPLACE(S,'‡','‡');
S := REPLACE(S,'€','€');
S := REPLACE(S,'‰','‰');
S := REPLACE(S,'Љ','Љ');
S := REPLACE(S,'‹','‹');
S := REPLACE(S,'Њ','Њ');
S := REPLACE(S,'Ќ','Ќ');
S := REPLACE(S,'Ћ','Ћ');
S := REPLACE(S,'Џ','Џ');
S := REPLACE(S,'ђ','ђ');
S := REPLACE(S,'‘','‘');
S := REPLACE(S,'’','’');
S := REPLACE(S,'“','“');
S := REPLACE(S,'”','”');
S := REPLACE(S,'•','•');
S := REPLACE(S,'–','–');
S := REPLACE(S,'—','—');
S := REPLACE(S,'™','™');
S := REPLACE(S,'љ','љ');
S := REPLACE(S,'›','›');
S := REPLACE(S,'њ','њ');
S := REPLACE(S,'ќ','ќ');
S := REPLACE(S,'ћ','ћ');
S := REPLACE(S,'џ','џ');
S := REPLACE(S,'Ў','Ў');
S := REPLACE(S,'ў','ў');
S := REPLACE(S,'Ј','Ј');
S := REPLACE(S,'Ґ','Ґ');
S := REPLACE(S,'Ё','Ё');
S := REPLACE(S,'Є','Є');
S := REPLACE(S,'Ї','Ї');
S := REPLACE(S,'І','І');
S := REPLACE(S,'і','і');
S := REPLACE(S,'ґ','ґ');
S := REPLACE(S,'ё','ё');
S := REPLACE(S,'№','№');
S := REPLACE(S,'є','є');
S := REPLACE(S,'ј','ј');
S := REPLACE(S,'Ѕ','Ѕ');
S := REPLACE(S,'ѕ','ѕ');
S := REPLACE(S,'ї','ї');
S := REPLACE(S,'А','А');
S := REPLACE(S,'Б','Б');
S := REPLACE(S,'В','В');
S := REPLACE(S,'Г','Г');
S := REPLACE(S,'Д','Д');
S := REPLACE(S,'Е','Е');
S := REPLACE(S,'Ж','Ж');
S := REPLACE(S,'З','З');
S := REPLACE(S,'И','И');
S := REPLACE(S,'Й','Й');
S := REPLACE(S,'К','К');
S := REPLACE(S,'Л','Л');
S := REPLACE(S,'М','М');
S := REPLACE(S,'Н','Н');
S := REPLACE(S,'О','О');
S := REPLACE(S,'П','П');
S := REPLACE(S,'Р','Р');
S := REPLACE(S,'С','С');
S := REPLACE(S,'Т','Т');
S := REPLACE(S,'У','У');
S := REPLACE(S,'Ф','Ф');
S := REPLACE(S,'Х','Х');
S := REPLACE(S,'Ц','Ц');
S := REPLACE(S,'Ч','Ч');
S := REPLACE(S,'Ш','Ш');
S := REPLACE(S,'Щ','Щ');
S := REPLACE(S,'Ъ','Ъ');
S := REPLACE(S,'Ы','Ы');
S := REPLACE(S,'Ь','Ь');
S := REPLACE(S,'Э','Э');
S := REPLACE(S,'Ю','Ю');
S := REPLACE(S,'Я','Я');
S := REPLACE(S,'а','а');
S := REPLACE(S,'б','б');
S := REPLACE(S,'в','в');
S := REPLACE(S,'г','г');
S := REPLACE(S,'д','д');
S := REPLACE(S,'е','е');
S := REPLACE(S,'ж','ж');
S := REPLACE(S,'з','з');
S := REPLACE(S,'и','и');
S := REPLACE(S,'й','й');
S := REPLACE(S,'к','к');
S := REPLACE(S,'л','л');
S := REPLACE(S,'м','м');
S := REPLACE(S,'н','н');
S := REPLACE(S,'о','о');
S := REPLACE(S,'п','п');
S := REPLACE(S,'р','р');
S := REPLACE(S,'с','с');
S := REPLACE(S,'т','т');
S := REPLACE(S,'у','у');
S := REPLACE(S,'ф','ф');
S := REPLACE(S,'х','х');
S := REPLACE(S,'ц','ц');
S := REPLACE(S,'ч','ч');
S := REPLACE(S,'ш','ш');
S := REPLACE(S,'щ','щ');
S := REPLACE(S,'ъ','ъ');
S := REPLACE(S,'ы','ы');
S := REPLACE(S,'ь','ь');
S := REPLACE(S,'э','э');
S := REPLACE(S,'ю','ю');
S := REPLACE(S,'я','я');
Are you looking for convert?
select CONVERT('шт', 'AL32UTF8', 'CL8MSWIN1251') from dual
I have not run it, because I am using UTF throuout DB, but you may need to play around with encodings.
And here is a link: http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm
Related
Colours of controls on custom wizard page are not correct on Windows 7 - Parallels (Inno Script)
Context: MacBook Pro (latest Big Sur 11.1) Parallels (latest) Windows 7 (all updates) When I run my setup, my custom page looks like this: Some text is showing black. This issue does not happen when you run my installer on native Windows 10 on a PC. My custom page is designed like this: // ================================================ // Automatic Backup Settings Page // ================================================ [Code] { Constants } const BackupWhat_None = 0; BackupWhat_Complete = 1; BackupWhat_Essential = 2; BackupMode_Automatic = 0; BackupMode_Manual = 1; BackupPrompt_Never = 0; BackupPrompt_Daily = 1; BackupPrompt_Weekly = 2; BackupPrompt_Monthly = 3; { Global Variables } var pageAutoBackup: TWizardPage; pnlBackupWhat: TPanel; lblBackupWhat: TLabel; radBackupWhatNone: TNewRadioButton; radBackupWhatComplete: TNewRadioButton; radBackupWhatEssential: TNewRadioButton; lblBackupMode: TLabel; pnlBackupMode: TPanel; radBackupModeAuto: TNewRadioButton; radBackupModeManual: TNewRadioButton; lblPromptMode: TLabel; cmbPromptMode: TNewComboBox; lblBackupFolder: TLabel; txtBackupFolder: TNewEdit; btnSelectBackupFolder: TNewButton; { Sets the state of the controls } procedure EnableAutoBackupSettingPageControls(); var bEnable: Boolean; begin bEnable := radBackupWhatComplete.Checked or radBackupWhatEssential.Checked pnlBackupMode.Enabled := bEnable; lblBackupMode.Enabled := bEnable; radBackupModeAuto.Enabled := bEnable; radBackupModeManual.Enabled := bEnable; lblPromptMode.Enabled := bEnable; cmbPromptMode.Enabled := bEnable; lblBackupFolder.Enabled := bEnable; txtBackupFolder.Enabled := bEnable; btnSelectBackupFolder.Enabled := bEnable; if(radBackupWhatNone.Checked = True) then Wizardform.NextButton.Enabled := True else Wizardform.NextButton.Enabled := DirExists(txtBackupFolder.Text); WizardForm.Update; end; { Ask user to select the backup Folder location } procedure btnSelectBackupFolder_Click(Sender: TObject); var strFolder: string; begin strFolder := txtBackupFolder.Text; { Display Browse Window } if(BrowseForFolder('', strFolder, True)) then begin txtBackupFolder.Text := strFolder; Wizardform.NextButton.Enabled := DirExists(txtBackupFolder.Text); WizardForm.Update; end; end; { Action handler } procedure radBackupWhat_Click(Sender: TObject); begin { Set control states } EnableAutoBackupSettingPageControls(); end; { Automatic Backup Settings Custom Page } function pageAutoBackup_CreatePage(PreviousPageId: Integer): Integer; var iButtonGap: Integer; begin { Create the page } pageAutoBackup := CreateCustomPage(PreviousPageId, ExpandConstant('{cm:pageAutoBackupTitle}'), ExpandConstant('{cm:pageAutoBackupDescription}')); { pnlBackupWhat (TPanel) } pnlBackupWhat := TPanel.Create(pageAutoBackup); pnlBackupWhat.Caption := ''; pnlBackupWhat.BevelOuter := bvNone; pnlBackupWhat.BevelInner := bvNone; { default } pnlBackupWhat.BevelKind := bkNone; pnlBackupWhat.Parent := pageAutoBackup.Surface; pnlBackupWhat.Enabled := True; pnlBackupWhat.Visible := True; pnlBackupWhat.Left := ScaleX(0); pnlBackupWhat.Top := ScaleY(0); pnlBackupWhat.Width := pageAutoBackup.Surface.Width; pnlBackupWhat.Anchors := [akLeft, akRight]; { lblBackupWhat (TLabel) } lblBackupWhat := TLabel.Create(pageAutoBackup); lblBackupWhat.Parent := pnlBackupWhat; lblBackupWhat.Enabled := True; lblBackupWhat.Visible := True; lblBackupWhat.Width := pnlBackupWhat.Width; lblBackupWhat.Caption := ExpandConstant('{cm:lblBackupWhat}'); { radBackupWhatNone (TNewRadioButton) } radBackupWhatNone := TNewRadioButton.Create(pageAutoBackup); radBackupWhatNone.Parent := pnlBackupWhat; radBackupWhatNone.Enabled := True; radBackupWhatNone.Visible := True; radBackupWhatNone.Top := lblBackupWhat.Top + lblBackupWhat.Height + ScaleY(2); radBackupWhatNone.Width := pnlBackupWhat.Width; radBackupWhatNone.Height := ScaleY(radBackupWhatNone.Height); radBackupWhatNone.Checked := False; radBackupWhatNone.Caption := ExpandConstant('{cm:radBackupWhatNone}'); radBackupWhatNone.OnClick := #radBackupWhat_Click; { radBackupWhatComplete (TNewRadioButton) } radBackupWhatComplete := TNewRadioButton.Create(pageAutoBackup); radBackupWhatComplete.Parent := pnlBackupWhat; radBackupWhatComplete.Enabled := True; radBackupWhatComplete.Visible := True; radBackupWhatComplete.Top := radBackupWhatNone.Top + radBackupWhatNone.Height + ScaleY(2); radBackupWhatComplete.Width := pnlBackupWhat.Width; radBackupWhatComplete.Height := ScaleY(radBackupWhatComplete.Height); radBackupWhatComplete.Checked := False; radBackupWhatComplete.Caption := ExpandConstant('{cm:radBackupWhatComplete}'); radBackupWhatComplete.OnClick := #radBackupWhat_Click; { radBackupWhatEssential (TNewRadioButton) } radBackupWhatEssential := TNewRadioButton.Create(pageAutoBackup); radBackupWhatEssential.Parent := pnlBackupWhat; radBackupWhatEssential.Enabled := True; radBackupWhatEssential.Visible := True; radBackupWhatEssential.Top := radBackupWhatComplete.Top + radBackupWhatComplete.Height + ScaleY(2); radBackupWhatEssential.Width := pnlBackupWhat.Width; radBackupWhatEssential.Height := ScaleY(radBackupWhatEssential.Height); radBackupWhatEssential.Checked := False; radBackupWhatEssential.Caption := ExpandConstant('{cm:radBackupWhatEssential}'); radBackupWhatEssential.OnClick := #radBackupWhat_Click; { Now we can set the panel height! } pnlBackupWhat.ClientHeight := radBackupWhatEssential.Top + radBackupWhatEssential.Height + ScaleY(5); { pnlBackupMode (TPanel) } pnlBackupMode := TPanel.Create(pageAutoBackup); pnlBackupMode.Caption := ''; pnlBackupMode.BevelOuter := bvNone; pnlBackupMode.BevelInner := bvNone; { default } pnlBackupMode.BevelKind := bkNone; pnlBackupMode.Parent := pageAutoBackup.Surface; pnlBackupMode.Enabled := True; pnlBackupMode.Visible := True; pnlBackupMode.Top := pnlBackupWhat.Top + pnlBackupWhat.Height + ScaleY(2); pnlBackupMode.Width := pageAutoBackup.Surface.Width; pnlBackupMode.Height := ScaleY(100); pnlBackupMode.Anchors := [akLeft, akRight]; { lblBackupMode (TLabel) } lblBackupMode := TLabel.Create(pageAutoBackup); lblBackupMode.Parent := pnlBackupMode; lblBackupMode.Enabled := True; lblBackupMode.Visible := True; lblBackupMode.Width := pnlBackupMode.Width; lblBackupMode.Caption := ExpandConstant('{cm:lblBackupMode}'); { radBackupModeAuto (TNewRadioButton) } radBackupModeAuto := TNewRadioButton.Create(pageAutoBackup); radBackupModeAuto.Parent := pnlBackupMode; radBackupModeAuto.Enabled := True; radBackupModeAuto.Visible := True; radBackupModeAuto.Left := ScaleX(0); radBackupModeAuto.Top := lblBackupMode.Top + lblBackupMode.Height + ScaleY(2); radBackupModeAuto.Width := pnlBackupMode.Width; radBackupModeAuto.Height := ScaleY(radBackupModeAuto.Height); radBackupModeAuto.Checked := False; radBackupModeAuto.Caption := ExpandConstant('{cm:radBackupModeAuto}'); { radBackupModeManual (TNewRadioButton) } radBackupModeManual := TNewRadioButton.Create(pageAutoBackup); radBackupModeManual.Parent := pnlBackupMode; radBackupModeManual.Enabled := True; radBackupModeManual.Visible := True; radBackupModeManual.Top := radBackupModeAuto.Top + radBackupModeAuto.Height + ScaleY(2); radBackupModeManual.Width := pnlBackupMode.Width; radBackupModeManual.Height := ScaleY(radBackupModeManual.Height); radBackupModeManual.Checked := False; radBackupModeManual.Caption := ExpandConstant('{cm:radBackupModeManual}'); { lblPromptMode (TLabel) } lblPromptMode := TLabel.Create(pageAutoBackup); lblPromptMode.Parent := pnlBackupMode; lblPromptMode.Enabled := True; lblPromptMode.Visible := True; lblPromptMode.Top := radBackupModeManual.Top + radBackupModeManual.Height + ScaleY(10); lblPromptMode.Width := pnlBackupMode.Width; lblPromptMode.Caption := ExpandConstant('{cm:lblPromptMode}'); { cmbPromptMode (TNewComboBox) } cmbPromptMode := TNewComboBox.Create(pageAutoBackup); cmbPromptMode.Parent := pnlBackupMode; cmbPromptMode.Style := csDropDownList; cmbPromptMode.Enabled := True; cmbPromptMode.Visible := True; cmbPromptMode.Top := lblPromptMode.Top + lblPromptMode.Height + ScaleY(5); cmbPromptMode.Width := pnlBackupMode.Width; cmbPromptMode.ItemIndex := 0; cmbPromptMode.Items.Add(ExpandConstant('{cm:cmbPromptModeItemNever}')); cmbPromptMode.Items.Add(ExpandConstant('{cm:cmbPromptModeItemDaily}')); cmbPromptMode.Items.Add(ExpandConstant('{cm:cmbPromptModeItemWeekly}')); cmbPromptMode.Items.Add(ExpandConstant('{cm:cmbPromptModeItemMonthly}')); cmbPromptMode.Anchors := [akLeft, akRight]; { Now we can set the panel height! } pnlBackupMode.ClientHeight := (cmbPromptMode.Top + cmbPromptMode.Height) + ScaleY(5); { lblBackupFolder (TLabel) } lblBackupFolder := TLabel.Create(pageAutoBackup); lblBackupFolder.Parent := pageAutoBackup.Surface; lblBackupFolder.Enabled := True; lblBackupFolder.Visible := True; lblBackupFolder.Top := pnlBackupMode.Top + pnlBackupMode.Height + ScaleY(2); lblBackupFolder.Width := pnlBackupMode.Width; lblBackupFolder.Caption := ExpandConstant('{cm:lblBackupFolder}'); lblBackupFolder.Anchors := [akLeft, akRight, akBottom]; { txtBackupFolder (TNewEdit) } txtBackupFolder := TNewEdit.Create(pageAutoBackup); txtBackupFolder.Parent := pageAutoBackup.Surface; txtBackupFolder.Enabled := True; txtBackupFolder.ReadOnly := True; txtBackupFolder.Visible := True; txtBackupFolder.Top := lblBackupFolder.Top + lblBackupFolder.Height + ScaleY(5); txtBackupFolder.Anchors := [akLeft, akRight, akBottom]; { btnSelectBackupFolder (TNewButton) } btnSelectBackupFolder := TNewButton.Create(pageAutoBackup); btnSelectBackupFolder.Parent := pageAutoBackup.Surface; btnSelectBackupFolder.Enabled := True; btnSelectBackupFolder.Visible := True; btnSelectBackupFolder.Left := pageAutoBackup.Surface.Width - WizardForm.CancelButton.Width; btnSelectBackupFolder.Top := txtBackupFolder.Top; btnSelectBackupFolder.Width := WizardForm.CancelButton.Width; btnSelectBackupFolder.Height := WizardForm.CancelButton.Height; btnSelectBackupFolder.Caption := SetupMessage(msgButtonBrowse); btnSelectBackupFolder.Anchors := [akRight, akBottom]; btnSelectBackupFolder.OnClick := #btnSelectBackupFolder_Click; { Now we can set the text box width! Use the gap between the Next and Cancel buttons for consistency.} iButtonGap := WizardForm.CancelButton.Left - (WizardForm.NextButton.Left + WizardForm.NextButton.Width); txtBackupFolder.Width := pageAutoBackup.Surface.Width - btnSelectBackupFolder.Width - iButtonGap; Result := pageAutoBackup.ID; end; function GetWhatToBackupMode(Param: string): string; begin if(radBackupWhatComplete.Checked) then begin Log('What to backup: Complete backup mode selected.'); Result := IntToStr(BackupWhat_Complete); end else if(radBackupWhatEssential.Checked) then begin Log('What to backup: Essential backup mode selected.'); Result := IntToStr(BackupWhat_Essential); end else begin Log('What to backup: No backup mode selected.'); Result := IntToStr(BackupWhat_None); end; end; function GetHowToBackupMode (Param: string): string; begin if(radBackupModeManual.Checked) then begin Log('How to backup: Perform the backup manually.'); Result := IntToStr(BackupMode_Manual); end else begin Log('How to backup: Perform the backup automatically.'); Result := IntToStr(BackupMode_Automatic); end; end; function GetBackupPromptMode (Param: string): string; begin Log('Where to backup: ' + cmbPromptMode.Items[cmbPromptMode.ItemIndex]); Result := IntToStr(cmbPromptMode.ItemIndex); end; function GetBackupLocationPath (Param: string): string; begin // If empty, use the app folder and create a backup folder (Param) Log(txtBackupFolder.Text); Result := txtBackupFolder.Text; end; procedure AutoBackupPage_InitializeWizard(AfterId: Integer); var dwBackupAtShutdownWhat: Cardinal; dwBackupAtShutdownHow: Cardinal; dwBackupPromptMode: Cardinal; strBackupFolder: String; begin pageAutoBackup_CreatePage(AfterId); { What to Backup } dwBackupAtShutdownWhat := BackupWhat_None; if (IsWin64) then begin RegQueryDWordValue(HKLM64, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownWhat', dwBackupAtShutdownWhat) end else begin RegQueryDWordValue(HKLM, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownWhat', dwBackupAtShutdownWhat); end; if (dwBackupAtShutdownWhat = BackupWhat_Complete) then begin radBackupWhatComplete.Checked := True; end else if (dwBackupAtShutdownWhat = BackupWhat_Essential) then begin radBackupWhatEssential.Checked := True; end else begin radBackupWhatNone.Checked := True; end; { How to Backup } dwBackupAtShutdownHow := BackupMode_Automatic; if (IsWin64) then begin RegQueryDWordValue(HKLM64, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownMode', dwBackupAtShutdownHow); end else begin RegQueryDWordValue(HKLM, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownMode', dwBackupAtShutdownHow); end; if (dwBackupAtShutdownHow = BackupMode_Manual) then begin radBackupModeManual.Checked := True; end else begin radBackupModeAuto.Checked := True; end; { Backup Prompt Mode } dwBackupPromptMode := BackupPrompt_Never; if (IsWin64) then begin RegQueryDWordValue(HKLM64, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupPromptMode', dwBackupPromptMode); end else begin RegQueryDWordValue(HKLM, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupPromptMode', dwBackupPromptMode); end; cmbPromptMode.ItemIndex := dwBackupPromptMode; { Backup Local Path } strBackupFolder := ''; if (IsWin64) then begin RegQueryStringValue(HKLM64, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownLocalPath', strBackupFolder); end else begin RegQueryStringValue(HKLM, 'Software\MeetSchedAssist\Meeting Schedule Assistant\Options', 'BackupAtShutdownLocalPath', strBackupFolder); end; { Do we need to reset the existing folder? } if(not DirExists(strBackupFolder)) then strBackupFolder := ''; txtBackupFolder.Text := strBackupFolder; end; procedure AutoBackupPage_CurPageChanged(CurPageID: Integer); begin if CurPageID = pageAutoBackup.ID then begin { Get the state of the Next button correct } if(radBackupWhatNone.Checked) then Wizardform.NextButton.Enabled := True else Wizardform.NextButton.Enabled := DirExists(txtBackupFolder.Text); WizardForm.Update; end; end; { Build the Memo text for the Auto Backup Settings page } function AutoBackupPage_MemoInfo(Space, NewLine: String): String; begin Result := Result + ExpandConstant('{cm:pageAutoBackupTitle}') + NewLine; { What to Backup } Result := Result + Space + ExpandConstant('{cm:lblBackupWhat}') + NewLine; if(radBackupWhatNone.Checked) then Result := Result + Space + Space + ExpandConstant('{cm:radBackupWhatNone}') + NewLine; if(radBackupWhatComplete.Checked) then Result := Result + Space + Space + ExpandConstant('{cm:radBackupWhatComplete}') + NewLine; if(radBackupWhatEssential.Checked) then Result := Result + Space + Space + ExpandConstant('{cm:radBackupWhatEssential}') + NewLine; if(radBackupWhatNone.Checked = False) then begin { How to Backup } Result := Result + Space + ExpandConstant('{cm:lblBackupMode}') + NewLine; if(radBackupModeAuto.Checked) then Result := Result + Space + Space + ExpandConstant('{cm:radBackupModeAuto}') + NewLine; if(radBackupModeManual.Checked) then Result := Result + Space + Space + ExpandConstant('{cm:radBackupModeManual}') + NewLine; { Prompt Mode } Result := Result + Space + Space + ExpandConstant('{cm:lblPromptMode}') + NewLine; if(cmbPromptMode.ItemIndex = BackupPrompt_Never) then Result := Result + Space + Space + Space + ExpandConstant('{cm:cmbPromptModeItemNever}') + NewLine; if(cmbPromptMode.ItemIndex = BackupPrompt_Daily) then Result := Result + Space + Space + Space + ExpandConstant('{cm:cmbPromptModeItemDaily}') + NewLine; if(cmbPromptMode.ItemIndex = BackupPrompt_Weekly) then Result := Result + Space + Space + Space + ExpandConstant('{cm:cmbPromptModeItemWeekly}') + NewLine; if(cmbPromptMode.ItemIndex = BackupPrompt_Monthly) then Result := Result + Space + Space + Space + ExpandConstant('{cm:cmbPromptModeItemMonthly}') + NewLine; { Backup Folder } Result := Result + Space + ExpandConstant('{cm:lblBackupFolder}') + NewLine; Result := Result + Space + Space + txtBackupFolder.Text + NewLine; end; Result := Result + NewLine; end; I am using skinning as you can see (#define Skin "Amakrits.vsf"). I didn't anticipate this rendering issue.
Works fine for me on latest Win 10. Your picture shows you have selected "Don't perform..." option which disables the controls in next group, that is a reason why the controls have different colors. Did you make any changes in the skin file Amakrits.vsf? My skin looks different (I downloaded it from GitHub few moments ago) and it looks like some tweaks are missing in my case. Conclusion: this is not an Inno Setup issue, but problem in VCL skinning plugin (try to post your issue here: https://github.com/RRUZ/vcl-styles-plugins/issues), but it looks like it can be improved by tweaking the colors in used .vsf file. P.S. your script could not be compiled correctly as there were missing Custom Messages and skin / setup initialization functions.
FireDAC under connecting freeze GUI
I'm facing with an issue, here is my code constructor TORAThread.Create; begin inherited Create(True); ORAFDcon_Ora := TFDConnection.Create(nil); ORAFDPhysOracleDriverLink := TFDPhysOracleDriverLink.Create(nil); ORAFDGUIxWaitCursor := TFDGUIxWaitCursor.Create(nil); ORAStorPRoc := TFDStoredProc.Create(nil); ORAFDcon_Ora.DriverName := 'ora'; ORAFDcon_Ora.LoginPrompt := False; ORAFDcon_Ora.Params.LoadFromFile('ORAconfig.ini'); ORAFDcon_Ora.CheckConnectionDef; ORAFDcon_Ora.ResourceOptions.AutoConnect := True; ORAFDcon_Ora.ResourceOptions.AutoReconnect := True; ORAFDcon_Ora.ResourceOptions.KeepConnection := True; ORAFDcon_Ora.ResourceOptions.CmdExecMode := amNonBlocking; procedure TORAThread.Execute; begin ORAFDcon_Ora.Connected := True; while not terminated do begin //somejobs end; When I start the thread and VPN connection is not alive, my GUI freezes Whats wrong? Regards,
Delphi: EoleSysError Exception
I get an EoleSysError exception after executing this line of code: FContainer.DoVerb(ovShow); When I open several word documents in the form, the exception doesn't occur. Here is an picture of the exception. For some reason, the error occurs when I want to open an excel file in the form This is my current code: procedure TForm1.FormActivate(Sender: TObject); var FDocument, FWord:Variant; FContainer: TOleContainer; begin FContainer := TOleContainer.Create(olecontainer1); FContainer.Modified := false; FContainer.Parent := olecontainer1; FContainer.Align := alClient; FContainer.CreateObject('Word.Document', true); FDocument := IDispatch(FContainer.OleObject); FWord := FDocument.Application; FContainer.DoVerb(ovShow); // olecontainer2 FContainer := TOleContainer.Create(olecontainer2); FContainer.Modified := false; FContainer.Parent := olecontainer2; FContainer.Align := alClient; FContainer.CreateObject('Excel.Application', true); FDocument := IDispatch(FContainer.OleObject); FWord := FDocument.Application; FContainer.DoVerb(ovShow); FContainer := TOleContainer.Create(olecontainer3); FContainer.Modified := false; FContainer.Parent := olecontainer3; FContainer.Align := alClient; FContainer.CreateObject('Word.Document', true); FDocument := IDispatch(FContainer.OleObject); FWord := FDocument.Application; FContainer.DoVerb(ovShow); FContainer := TOleContainer.Create(olecontainer4); FContainer.Modified := false; FContainer.Parent := olecontainer4; FContainer.Align := alClient; FContainer.CreateObject('Excel.Application', true); FDocument := IDispatch(FContainer.OleObject); FWord := FDocument.Application; FContainer.DoVerb(ovShow); end;
How to use io.Pipe() for chunking a Large file using Erasure Coding through ReedSolomon Library
Using https://github.com/klauspost/reedsolomon, erasure coding a large file into smaller chunks, I want to use io.Pipe() to create a stream of pipes which connects each other. For example: one pipe which helps in Chunking the file and other which calls func Upload for uploading the file func (rd *ReedSolomon) Chunking() { fname := rd.File // Create encoding matrix. enc, err := reedsolomon.NewStream(rd.data, rd.Par) checkErr(err) fmt.Println("Opening", fname) f, err := os.Open(fname) checkErr(err) instat, err := f.Stat() checkErr(err) shards := rd.Data + rd.Par out := make([]*os.File, shards) // Create the resulting files. dir, file := filepath.Split(fname) if fi.OutDir != "" { dir = fi.OutDir } for i := range out { outfn := fmt.Sprintf("%s.%d", file, i) out[i], err = os.Create(filepath.Join(dir, outfn)) checkErr(err) } // Split into files. data := make([]io.Writer, rd.Data) for i := range data { data[i] = out[i] } // Do the split err = enc.Split(f, data, instat.Size()) checkErr(err) // Close and re-open the files. input := make([]io.Reader, rd.Data) target_url := "http://localhost:8080" for i := range data { out[i].Close() f, err := os.Open(out[i].Name()) checkErr(err) input[i] = f defer f.Close() } // Create parity output writers parity := make([]io.Writer, rd.Par) for i := range parity { parity[i] = out[rd.Data+i] defer out[rd.Data+i].Close() } err = enc.Encode(input, parity) checkErr(err) for _, sd := range out { postFile(sd.Name(), target_url) } } I am pretty new to the use of the io.Pipe()
Inno Setup - How to change a label caption [or other controls in general], when selected value in combox box changes
When changing a language in combo box (without clicking ok), I want to change texts of the dialog (label, form caption, button caption) procedure SelectLanguage(); var LanguageForm: TSetupForm; CancelButton: TNewButton; OKButton: TNewButton; LangCombo: TNewComboBox; SelectLabel: TNewStaticText; Languages: TStrings; Params: string; Instance: THandle; P, I: Integer; S, L: string; begin Languages := TStringList.Create(); Languages.Add('en=English'); Languages.Add('cs='+#$010C+'e'+#$0161+'tina'); LanguageForm := CreateCustomForm; LanguageForm.Caption := SetupMessage(msgSelectLanguageTitle); LanguageForm.ClientWidth := ScaleX(297); LanguageForm.ClientHeight := ScaleY(125); LanguageForm.BorderStyle := bsDialog; LanguageForm.Center; CancelButton := TNewButton.Create(LanguageForm); CancelButton.Parent := LanguageForm; CancelButton.Left := ScaleX(214); CancelButton.Top := ScaleY(93); CancelButton.Width := ScaleY(75); CancelButton.Height := ScaleY(23); CancelButton.TabOrder := 3; CancelButton.ModalResult := mrCancel; CancelButton.Caption := SetupMessage(msgButtonCancel); OKButton := TNewButton.Create(LanguageForm); OKButton.Parent := LanguageForm; OKButton.Left := ScaleX(133); OKButton.Top := ScaleY(93); OKButton.Width := ScaleX(75); OKButton.Height := ScaleY(23); OKButton.Caption := SetupMessage(msgButtonOK); OKButton.Default := True OKButton.ModalResult := mrOK; OKButton.TabOrder := 2; LangCombo := TNewComboBox.Create(LanguageForm); LangCombo.Parent := LanguageForm; LangCombo.Left := ScaleX(16); LangCombo.Top := ScaleY(56); LangCombo.Width := ScaleX(273); LangCombo.Height := ScaleY(21); LangCombo.Style := csDropDownList; LangCombo.DropDownCount := 16; LangCombo.TabOrder := 1; SelectLabel := TNewStaticText.Create(LanguageForm); SelectLabel.Parent := LanguageForm; SelectLabel.Left := ScaleX(16); SelectLabel.Top := ScaleY(8); SelectLabel.Width := ScaleX(273); SelectLabel.Height := ScaleY(39); SelectLabel.AutoSize := False SelectLabel.Caption := SetupMessage(msgSelectLanguageLabel); SelectLabel.TabOrder := 0; SelectLabel.WordWrap := True; for I := 0 to Languages.Count - 1 do begin P := Pos('=', Languages.Strings[I]); L := Copy(Languages.Strings[I], 0, P - 1); S := Copy(Languages.Strings[I], P + 1, Length(Languages.Strings[I]) - P); LangCombo.Items.Add(S); if L = ActiveLanguage then LangCombo.ItemIndex := I; end; if LanguageForm.ShowModal = mrOK then begin { ... } end; end; function InitializeSetup(): Boolean; begin SelectLanguage(); { ... } end; Spanish: first language. I select English and no change the language of the language selector.
You have the code already. You just need to make some local variables in the SelectLanguage function global, so they can be used in the LangChange function: var LanguageForm: TSetupForm; SelectLabel: TNewStaticText; CancelButton: TNewButton; procedure LangChange(Sender : TObject); begin case TNewComboBox(Sender).ItemIndex of 0: { English } begin SelectLabel.Caption := 'Select the language to use during the installation:'; CancelButton.Caption := 'Cancel'; LanguageForm.Caption := 'Select setup language'; end; 1: { Czech } begin SelectLabel.Caption := 'Zvolte jazyk, kter'+#$FD+' se m'+#$E1+' pou'+#$17E+#$ED+'t b'+#$11B+'hem instalace:'; CancelButton.Caption := 'Storno'; LanguageForm.Caption := 'V'+#$FD+'b'+#$11B+'r jazyka pr'+#$16F+'vodce instalac'+#$ED+''; end; end; end; In the SelectLanguage, remove these the declarations of local variables: LanguageForm: TSetupForm; SelectLabel: TNewStaticText; CancelButton: TNewButton; And assign the LangChange event handler: LangCombo.OnChange := #LangChange;